-
-
Save agiliq/254073 to your computer and use it in GitHub Desktop.
This file contains 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
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