Our BLOG

Building Cheerify.it

Cheerify.it started with a simple idea: What would a website look like if you could decorate it with Christmas lights and sync it music. We've been wanting to play with using browser bookmarks to manipulate the contents of a website, so we extended the original idea to be able to "Cheerify" any website. Taking over a website via browser bookmarks is not a new idea. Because javascript runs on the client side, there is a lot of potential for automation of redundant tasks. We wanted to create something less useful but more fun. Something along the lines of the Doge bookmark, YAAARRRify bookmark and Harlem Shake bookmark but just a little more ridiculous. Building The Prototype We had seen bookmarks manipulate elements on screen to music before. The tricky part was going to be building a framework that allowed us to easily sync animations to music. First, I want to give a huge shout out to Moovweb for their Harlem Shake bookmarklet. Not only did it serve as a source of inspiration but it gave me a great place to start building out my framework. The original Harlem Shake bookmarklet works by inserting an HTML5 audio element into the page and using a setTimeout to wait 15 seconds before making everything on the screen go crazy. They've since updated their code on GitHub to a more reliable method, but I'll get to that in a second. So using the Harlem Shake code as a starting point, we built a framework for adding effects to a timeline. Our framework uses a setInterval() to check the HTML5 audio's currentTime property every 10th of a second. We then iterate through an array of effects to trigger as we approach each timestamp. The array is made up of smaller arrays that include a timestamp and a function to call. Using anonymous functions within our effects array kept our code readable and made it easy for other developers to help orchestrate. It's important to note I could have also used the timeupdate event of the audio element instead of set interval; however, setInterval allowed us to control our proprietary frame rate. HTML5/CSS3 As browsers become smarter, we can do cooler things with them. In this case, we used Cheerify.it as an excuse to play with some of the more cutting edge features of modern browsers like CSS3 animations and HTML5 audio. HTML5 Audio Html5 Audio has come a long way. For this experience, we didn't worry about creating fallbacks for older browsers like we normally would. We've used MediaElements.js on several websites in the past with great success. This time around we kept it simple using only two source files, MP3 and OGG. We then took advantage of the audio element's methods and properties to keep the animations in sync with the music as well as create a little music player that allows users to play/pause and mute the whole experience. CSS3 The real fun was coming up with CSS3 animations. Every animation was made using pure CSS3, even the dancing snowman. Only thing we could have done better with the snowman is used the animation-delay property instead of setTimeout() to trigger different parts of the animation. Both work, just in the future, CSS over javascript. Vanilla Javascript When it came time to writing the javascript that made the magic happen, we decided early on we would build it without jQuery. We mainly did this because we didn't need it. It was also an opportunity to brush up on our DOM manipulation-fu while exploring some of the lesser used ways of selecting elements. To make things easier while we animated, we created a javascript object of arrays of elements that could be manipulated. We started by grabbing all of the elements on screen, document.getElementsByTagName("*"). We then looped through all of the elements and added them to our object of arrays based on: How big they were Where they were located Whether they were hidden or not Whether they were within the viewport or not Then, we created a function for adding effects to elements. This function would add a class to an element and remove it after a set amount of time. This is how we animate all of the things. Creating An Easier Way To Share The Experience All of our early prototypes were executed using the browser bookmark. This made things easy because all I had to do was insert my javascript file before the closing body tag and the whole experience would start. We all agreed however that browser bookmarks are not as intuitive as we needed the experience to be. Our solve for this was to allow people to Cheerify their site by typing a URL into an input box and then pressing "Cheerify It". To accomplish this we used PHP to test if we had a site to cheerify. After grabbing and cleaning up the URL, we used CURL to get the contents of the web page. This is where it got a bit mucky. We assumed that the destination site had well-formed HTML and attempted to insert our cheerify script before the closing body tag. Believe it or not, there are sites out there that have more than one body tag and others with no body tag at all. So, now we had a URL that looked something like http://www.cheerify.it/?site=https://www.ampagency.com with all of the contents of that page grabbed, manipulated and ready to output to the browser. We then echoed out our manipulated HTML and hoped all was well. It wasn't, yet. Using this method, we made several assumptions about how the HTML was formatted. We also had broken paths to all assets using relative URLs. To fix this, we did a very primitive preg_replace to replace all relative paths with absolute ones. This fixed relative URLs in the HTML but not relative URLs lazy loaded with javascript. This was probably the hackiest part of the whole project. To fix broken sites that add content with javascript, we did another search and replaced on all paths after the DOM was fully loaded and all javascript had been executed. I then overwrote the javascript alert() function to silently output to the console to avoid any other interruptions. Going Live One of my favorite development automation tools is Grunt. It played a huge part in automating the staging, minification, auto-prefixing and de-linting of the code during the development process. I've included a modified version of the Gruntfile.js we used in the Cheerify.it GitHub repo. Wrap Up The Cheerify site was a lot of fun to work on and and the team did a great job turning the whole project around in a short time frame. Check out the Cheerify.it Source Code on Github and leave a comment below with your thoughts. Finally, don't forget to Cheerify this page.

The Holidays ' A Season for Sharing

We've all seen it, a news feed or Twitter stream full of promotional verbiage like: Check out these great deals Click here for this season's best offer Our biggest holiday sale By now, most consumers are numb to this type of marketing speak, which makes cutting through the holiday noise even harder. Yes, we said holiday. Thankfully, the first frost has not made its way to our front yards just yet, but in order to ensure success this holiday season, now is the time to be developing a thoughtful social media strategy and cultivating brand affinity. According to the basic principles of Public Relations, people consume media to fulfill four primary objectives: to be informed, to be entertained, to feel a sense of belonging, and to develop opinions. Social media is no different. Since 1998, research providers, Edison Research and Arbitron have been conducting surveys about how people use the Internet. With the unveiling of their 2012 Social Habit study, 'How Americans Really Use Social Media,'? it seems not much about human nature has changed. The number-one reason Americans polled follow brands online is for sales/discounts/coupons. Other reasons for following include: To stay informed about new products For 'content/ideas" For 'news/information" For  'humorous/entertaining content" While it is no surprise that a consumer's desire to receive discounts and special offers was the top reason for 'liking'? a brand, brands should take notice that users also want to be entertained, and many look to follow brands and share posts that have engaging content. Thus, the secret to standing out on social media this holiday season and beyond is to be entertaining. Get in the holiday spirit by keeping it real. The most successful social brands are those that approach social media like a human interacting with a human; they are transparent, authentic, relevant, and consistent. So how do we roll that into one big ball of entertainment that gets fans, followers, and likers talking? Think outside the box. Here are a few ideas to help you start building your holiday momentum early. Offer advice to common holiday challenges and ask users about their challenges Encourage user-generated content ' what was your best childhood Halloween costume or photo of best Black Friday buy Make use of reality ' encourage users to upload real-time shopping updates, photos of favorite purchases, etc. Encourage new and old customers to review your brand and products ' users rely on other users Social giving ' do it and encourage it ' Share how your brand is giving back to the community and how your brand followers are doing the same Fun contests and giveaways ' everyone loves free stuff, especially when it's a surprise or reward for positive engagement Themed countdowns ' Give users something to look forward to, other than quality time with the family and presents Social media is a channel to help brands pull back the curtain and let customers connect with brands on a more personal level. Holiday social media engagement shouldn't be limited to a few months of flash sales; it should be a year round relationship. Using the holiday season to encourage engagement could also help build bigger engagement overall. It's important to keep in mind that  if you are going to launch something new for holiday that you are able to sustain it throughout the year to yield the greatest benefits. Happy sharing!

Will It Be a Green Holiday Season for Retailers?

According to the most recent holiday survey done by the National Retail Federation, American consumers are planning on spending an average of just under $689 on holiday-related items, a slightly higher amount than the average from last holiday season. Because the recession is far from over, capturing this spending by retailers could make or break them for 2010. Suppliers are heavily invested in this capture as well, obviously because they depend on the retail outlets to move their products. According to the survey, almost 2/3 of American shoppers have said the economy will impact their spending. Some will spend less, some will shop for the best price, some will use coupons and some will surf the web to find the best bang for their buck. What this means to retailers is that they have to find a way to make their outlet the most attractive to consumers. According to the survey, customer service and merchandise quality are two very important factors to consumers. These are two ways that retailers don't have to be creative in order to supply what consumers want, they just need to be diligent and ensure their employees have a positive attitude toward their customers, make themselves available to assist consumers and do a good job of quality control and carry merchandise that has a strong track record of being a solid product. Surprisingly, the younger demographic (18-24) had the highest percentage of responders that said they will choose a store based on service. With that being the demographic that uses electronic media the most, a good, positive shopping experience with just one consumer could bring you dozens more. The flipside is also true. A bad experience could end up costing you hundreds, maybe more, in sales. Many consumers this season will be more focused on value and not just price. They will be looking more at the big picture. Paying more for longevity or for less hassle (like paying $100 for the fake Christmas tree vs. $75 for the real, but think of the ease of clean up after the holiday) is part of the value equation. Getting more satisfaction for your money, even if it means spending a little more, seems to be a trend many are following. One of the biggest trends from the study (although not a surprise) is that online shoppers have much deeper pockets this year.  According to the survey, people who are holiday shopping online will spend 24.6 percent more than the average adult.  This group starts shopping early and tends to make a lot of non-gift purchase for themselves.   This group is willing to pay more and is said that sales and discounts are not their main factor when shopping online. Regardless of the online phenomenon, many of us still enjoy the 'live'? experience of shopping in 'Brick and Mortar'? stores during the holiday season. As a holiday consumer, here are a few tips to keep our experience with you positive and ultimately green!! 1.) Offer quality and value at a reasonable price. 2.) Have top-notch customer service (who doesn't appreciate service with a smile?) 3.) Remember I use my smartphone, so the opportunities to drive me to retail are endless

World's Largest Elf Party

What do you get when you mix a scenic NYC holiday environment, stars for an upcoming holiday movie and 607 elf-outfitted people? A Guinness World Record of course! AMP in partnership with ABC Family staged the 'World's Largest Elf Party'? at The Pond in Bryant Park on Monday, December 7th. In support of ABC Family's release of Santa Baby 2: Christmas Maybe, AMP pulled off this world-record setting gathering of Santa's Elves. The movie's stars, Jenny McCarthy, Dean McDermott, Candace Cameron Bure and Peri Gilpin were all on hand to take part in the day's stunt. General consumer 'Party'? participants were invited through 'Elf'? street teams to take part in the event. All participants received a full elf costume, boxed lunches and earned giveaways from our stage activities including caroling with Emcee 'Honkey'? Lange and DJ Mike Roc under the lit Christmas Tree at Bryant Park. At 1:00PM EST all 'elves'? were moved onto the ice rink, and a ten-minute countdown began in order to establish a new Guinness World Record. After only a 15-minute adjudication period to confirm and qualify the total number of participants, Danny Girton from Guinness World Records presented the movie's stars, Jenny McCarthy and Dean McDermott with an Official Guinness plaque commemorating the accomplishment. The stunt proved to be a press hit with ABC Family receiving press coverage from multiple media sources including, 'The View'?, 'Access Hollywood'?, 'The Insider'?, AP, People.com, In Touch Magazine, Media Life and even global sources such as the BBC and NTDTV in China! Santa Baby 2: Christmas Maybe was broadcast on Sunday, December 13th on ABC Family and became the #1 rated cable movie for the season and was the evening's #1 scripted cable program in total viewers and core demographic 18-49 year olds* (*Nielson Media Research)

  • 1 min read
  • December 16, 2009

World's Largest Elf Party

What do you get when you mix a scenic NYC holiday environment, stars for an upcoming holiday movie and 607 elf-outfitted people? A Guinness World Record of course! AMP in partnership with ABC Family staged the 'World's Largest Elf Party'? at The Pond in Bryant Park on Monday, December 7th. In support of ABC Family's release of Santa Baby 2: Christmas Maybe, AMP pulled off this world-record setting gathering of Santa's Elves. The movie's stars, Jenny McCarthy, Dean McDermott, Candace Cameron Bure and Peri Gilpin were all on hand to take part in the day's stunt. General consumer 'Party'? participants were invited through 'Elf'? street teams to take part in the event. All participants received a full elf costume, boxed lunches and earned giveaways from our stage activities including caroling with Emcee 'Honkey'? Lange and DJ Mike Roc under the lit Christmas Tree at Bryant Park. At 1:00PM EST all 'elves'? were moved onto the ice rink, and a ten-minute countdown began in order to establish a new Guinness World Record. After only a 15-minute adjudication period to confirm and qualify the total number of participants, Danny Girton from Guinness World Records presented the movie's stars, Jenny McCarthy and Dean McDermott with an Official Guinness plaque commemorating the accomplishment. The stunt proved to be a press hit with ABC Family receiving press coverage from multiple media sources including, 'The View'?, 'Access Hollywood'?, 'The Insider'?, AP, People.com, In Touch Magazine, Media Life and even global sources such as the BBC and NTDTV in China! Santa Baby 2: Christmas Maybe was broadcast on Sunday, December 13th on ABC Family and became the #1 rated cable movie for the season and was the evening's #1 scripted cable program in total viewers and core demographic 18-49 year olds* (*Nielson Media Research)

    Related Posts