]> projects.mako.cc - wikipedia-api-cdsw/blob - wikipedia1-1.py
ca021d199a9007b281969694896706df5a3913d2
[wikipedia-api-cdsw] / wikipedia1-1.py
1 import requests
2
3 wp_call = requests.get('https://en.wikipedia.org/w/api.php?action=query&prop=revisions&titles=Python_(programming_language)&rvlimit=100&rvprop=timestamp|user&continue=&format=json')
4
5 response = wp_call.json()
6
7 for page_id in response["query"]["pages"].keys():
8     page_title = response["query"]["pages"][page_id]["title"]
9     revisions = response["query"]["pages"][page_id]["revisions"]
10
11     for rev in revisions:
12         print(page_title + "\t" + rev["user"] + "\t" + rev["timestamp"])
13

Benjamin Mako Hill || Want to submit a patch?