Hacker News new | past | comments | ask | show | jobs | submit login
Egg.js – A Simple Way to Add Easter Eggs to Your Site (thatmikeflynn.com)
54 points by mikeflynn on April 21, 2015 | hide | past | favorite | 14 comments

Seems to me you could just use mousetrap.js and get the added bonus of a solid key capture library.


I really like the url structure for his projects...

I did the same thing (but with jQuery) around 5 years ago; https://github.com/jbrooksuk/jQuery-Contra

I'm pretty sure that it's in need of an update...

Does anyone here have experience using easter eggs as a social traffic-driving tool?

We have a client with a great product (well respected in their field) and one of our developers spent a weekend voluntarily building a very cool easter egg for their site. I think posting the easter egg somewhere relevant to their user base (like a topical subreddit) might be an interesting "campaign" to drive new users to the site.

Has anyone done this before?

Would this be the modern equivalent of "Press 7 to hear a duck quack"? :)


Apparently, TD Ameritrade does not share the same sense of humor.

Not on huge scale, but I've done something like that a few times for various projects. I had some built in to radio station websites I did many jobs ago and once mentioned on air we saw a bump in people typing random stuff. We talked about making it in to a contest, but never got past the discussion phase.

I did it for Newsweek a long time ago, purely as a real easter egg. (http://nymag.com/daily/intelligencer/2010/06/newsweekcom_zom...)

Although I put it in as an actual easter egg, I learned a couple lessons along the way about making it work:

1. Respect the brand. In my case, I wrote all the stories in the voice of Newsweek. I maintained the site styles and even used their tagging system. This works a lot better than just spraypainting glitter unicorns all over your homepage. It's very easy just to put a velociraptor or glitter unicorns on the homepage; the truly good easter eggs work with the content already on the page (see also: Google "do a barrel roll")

2. Disable ads. Gotta respect your advertisers, and they may not want to be associated with farcical zombie content. This also saved me from getting fired.

3. Don't promote or endorse it. In our case, it was on the site for a couple weeks before one of our writers noticed and tweeted it. The egg picked up steam like crazy, probably because of point #1 and due to being good satire. I mean, Newsweek seriously reporting on the zombie apocalypse? Gold Jerry! Of course, such a thing only works if (a. someone feels like they discovered it and (b. it seems like it could get taken down at any moment. We actually saw more traffic once our killjoy PR rep announced it would be taken down soon.

4. Provide multiple hooks. Sure, you can go to the site and punch in the konami code. Not everyone knew that. Tons of people thought you had to enter "up up down down left right left right b a" into our search box. So many that for the 2 days after it went viral, our top 500 search terms were variations on the code. If you go viral, be prepared for the people who have heard about it second or third hand.

5. Be prepared for the traffic. We went from 40k homepage visits to 400k. Lucky for us we had multiple amazon instances and solid caching. Newsweek as a company was used to the occasional traffic slam. If you succeed in going viral, be prepared for a very sudden spike in traffic.

6. Convert! We sucked at this one, obviously because we weren't planning for it. You've got all this traffic at your site, now what? That's up to you...

All in all, I wouldn't expect forcing an easter egg to work. Newsweek succeeded for me because I satirized the brand in a friendly way without hurting anyone or breaking anything. We got lucky and were able to handle the load. Once we had critical momentum our PR rep created an artificial scarcity by announcing it would be taken down.

In the end, it also didn't really work. High bounce rate, not many conversions, and the company had so many problems beyond that...

There's another lightweight version to do this here: https://github.com/mckamey/konami-js

This includes a minified version resulting in a <1 kb addition to code: https://github.com/FlorianBezagu/Konamiz/blob/master/konamiz...

Also worth considering is konami-js (https://github.com/snaptortoise/konami-js/blob/master/konami...), which treats cases different such as if running from iphone if not wishing to change to the standard code.

Quite similar to cheet.js (sic):


There's is a little more feature rich, but 2x as many characters minified (appro. 3K for cheet.js Vs 1.5K for Egg.js) which does matter for an Easter Egg in my opinion (as it should be as close to "free" as possible).

I like cheet.js better, the code seems much easier to read.

First thing I did was check for an easter egg on this site :)

heads up, in Safari, there is the following error: TypeError: undefined is not a function (evaluating 'Number.isInteger(parseInt(a, 10))')

Thanks for the heads up! Jumping on it now.

Edit: All fixed!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact