public
Last active

  • Download Gist
flickr_photo_detail_finder.py
Python
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
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']

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.