Skip to content

Instantly share code, notes, and snippets.

@agiliq
Forked from lprsd/flickr_photo_detail_finder.py
Created December 11, 2009 08:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agiliq/254073 to your computer and use it in GitHub Desktop.
Save agiliq/254073 to your computer and use it in GitHub Desktop.
ids = ['4153869960',
'4160152863',
'4165131655',
'4164906099',
'4165892330',
'4165146115']
import urllib
import json
query = "http://query.yahooapis.com/v1/public/yql?q=select%20owner%2Curls%20from%20flickr.photos.info%20where%20photo_id%3D'%s'&format=json"
query_part1 = "http://query.yahooapis.com/v1/public/yql?q=select%20owner%2Curls%20from%20flickr.photos.info%20where%20photo_id%3D"
query_part3 = "&format=json"
query_list = [query_part1+el+query_part3 for el in ids]
for el in query_list:
response_string = urllib.urlopen(el).read()
response_structure = json.loads(response_string)
print response_structure['query']['results']['photo']['owner']['username'], response_structure['query']['results']['photo']['urls']['url']['content']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment