2 import simplejson as json
3 from urllib2 import urlopen
5 url_base = 'https://en.wikipedia.org/w/api.php?action=query&prop=revisions&titles=%s&rvlimit=100&rvprop=timestamp|user&format=json'
7 pages = ["Benjamin_Mako_Hill", "Python", "Data_science"]
9 for page_title in pages:
11 wp_call = urlopen(url_base % page_title)
12 response = json.loads(wp_call.read())
14 for page_id in response["query"]["pages"].keys():
15 page_title = response["query"]["pages"][page_id]["title"]
16 revisions = response["query"]["pages"][page_id]["revisions"]
19 print page_title + "\t" + rev["user"] + "\t" + rev["timestamp"]