Created
September 4, 2014 21:47
-
-
Save Dru89/0d8376f81068825690d0 to your computer and use it in GitHub Desktop.
Get all the images from http://xkcd.com/1416/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get all the images from http://xkcd.com/1416/ | |
import urllib2 | |
import json | |
ids = [] | |
def process(id): | |
if id in ids: return | |
ids.append(id) | |
data = json.loads(urllib2.urlopen("http://c.xkcd.com/turtle/{}".format(id)).read()) | |
for id in data.get("white", []): | |
process(id) | |
for id in data.get("black", []): | |
process(id) | |
process('turtles') | |
print "\n".join(map(lambda id: "https://sslimgs.xkcd.com/turtledown/{}-tiled".format(id), sorted(ids))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment