]> projects.mako.cc - wikipedia-api-cdsw/blob - wikipedia-mwc1.py
cac057603c24ba529ac05d23e487abed98be0314
[wikipedia-api-cdsw] / wikipedia-mwc1.py
1 import time
2 import json
3 import mwclient
4
5 def format_time(t):
6     return(time.strftime('%Y-%m-%d %H:%M:%S', t))
7
8 site = mwclient.Site('en.wikipedia.org')
9
10 page = site.Pages["Data science"]
11
12 for revision in page.revisions():
13     print revision["user"] + "\t" + format_time(revision['timestamp'])

Benjamin Mako Hill || Want to submit a patch?