Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
ids = ['4153869960',
import urllib
import json
query = "'%s'&format=json"
query_part1 = ""
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