7

The latest (as of now) comic is titled "Time". It's a standard-looking comic though without much action, but the picture's alt title says "Wait for it.". I waited but nothing happened (tried in Opera and IE9) so I took a look at the page source.

Next to the picture's <img> tag there was a <script> which included the following URL:

http://imgs.xkcd.com/static/time07.min.js

I tried to make sense of it, but I can't figure it out. Can someone explain how it works and what was supposed to happen?

  • 1
    explainxkcd can and did (at least partially) – Gilles 'SO- stop being evil' Mar 27 '13 at 1:29
  • @Gilles: interesting! However, there doesn't seem to be much explanation on what exactly the script does, but more of "here's the URLs it fetches". I hope someone can post an overview of the script's main parts and how they interact. I, for one, am lost in all the callbacks and closures. – Igor Skochinsky Mar 27 '13 at 1:58
  • Perhaps it is a social experiment and is counting how long a person will wait for the image to change? – d1str0 Mar 27 '13 at 21:59
9

Somebody at XKCD fora pasted a link to this gist which contains a deobfuscated and annotated source along with some explanations:

The main part of Javascript that drives xkcd's "Time" comic (http://xkcd.com/1190/), deobfuscated and annotated. The bulk of the script seems to be an implementation of EventSource - which, while important, is not terribly interesting for our purposes, so I've omitted it here. After some Googling around, I am in fact fairly certain that the EventSource implementation used here is https://github.com/Yaffle/EventSource - after minifying and beautifying that code, it looks very similar to what shows up in time07.min.js.

As far as I can tell, it has no magic in it and serves just as a simple way for the server to let the client know when there is a new image.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.