Click and Drag Downloader

Ajax + PHP downloader for the impressive xkcd #1110.

What’s this?

While browsing this xkcd „strip”, I’ve followed every line and every tunnel I’ve found. But then I thought: How many hidden elements have I missed?

So I’ve hacked this little tool which lets you download the entire Click and Drag world.

What’s inside

First I wanted to browse through the JavaScript behind #1110, but I’ve found it easier to just use Fiddler. Looking at the requests made while browsing through the image, I’ve concluded that:

  • The entire image is made of PNG tiles, 2048×2048 pixels each.
  • Tiles are named with geographical coordinates, i.e. their horizontal west/east position and vertical north/south position relatively to image’s center.
  • Some tiles are missing; these are filled black or white whether these are underground or not.
  • Horizontal borders are 33 west and 48 east.
  • Vertical borders are probably not defined, but it seems there’s nothing interesting above 13 north or below 19 south.

If you know where to look for tiles representing specific coordinates, then the problem is really simple to solve.

I’ve decided to create this little PHP script, which lets you specify your image borders and then downloads everything as follows or specific tiles only.

Full jQuery code is included within the script and __halt_compiler() is used to extract it.

Usage is pretty simple, if you know how to run it then you’ll know how to use it ;)

Some interesting facts about the image:

  • It’s 81×32 tiles, 2592 tiles total, 2367 of these are pure black or pure white.
  • It’s 165888×65536 pixels, which is 10368 megapixels or 10,3 gigapixels.
  • It takes only 6 MB of disk space.
  • There are 11 tiles that aren’t connected to other ones, which means these are hard to find without cheating.
  • Browsing through the image, you can find many medusas (even underground ones) and flying whales.
  • 4 tiles look empty, but exist on the server and are downloadable anyway. I think it’s some kind of easter egg (especially considering their coordinates), or maybe there’s also some steganographic action going on there? These four are:
    11N 11W, 11N 11E, 11S 11W, 11S 11E

Have I missed anything important? Let me know in the comments below!

Map of existing tiles, including four empty ones.

Get the source code.