Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
#!/usr/bin/env python
Print out a list of links between Flickr and Chronicling America. These are newspaper pages that have had images extracted from them, that have been uploaded to Flickr by Dave Woodward.
import json
import urllib
def newspaper_photo_ids():
u = '' % key
photos = json.loads(urllib.urlopen(u).read())
return photos['photoset']['photo']
def flickr_url(photo_id):
return '' % photo_id
def chronam_url(photo_id):
u = '' % (key, photo_id)
j = json.loads(urllib.urlopen(u).read())
for tag in j['photo']['tags']['tag']:
if '' in tag['raw']:
return tag['raw'].replace('dc:identifier=', '')
return None
def flickr_chronam_links():
for photo in newspaper_photo_ids():
yield flickr_url(photo['id']), chronam_url(photo['id'])
for link in flickr_chronam_links():
print link
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.