8

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?

asheeshr
  • 2,465
  • 8
  • 28
  • 41
Igor Skochinsky
  • 36,553
  • 7
  • 65
  • 115

1 Answers1

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.

0xea
  • 4,904
  • 1
  • 23
  • 30