I'm trying to figure out how to get all of the page revisions for a specified timeframe. I have created a python script which allows me to get the last 100 revisions, but I don't see anything that allows me to specify a timeframe. I do see the following parameters:
rvstart: Timestamp to start listing from. (enum)
rvend: Timestamp to end listing at. (enum)
However, I'm not able to get these to work. They work if I put in a timestamp that exists as a revision timestamp, but not as an arbitrary range from which to encapsulate. Does anyone have any thoughts?
Here is my script, if you're interested:
import json
from wikitools import wiki, api
site = wiki.Wiki("http://en.wikipedia.org/w/api.php")
names = ["Sherrod Brown","Maria Cantwell"]
allMembers = []
for name in names:
params = {'action':'query',
'titles': name,
'prop':'revisions',
'rvprop':'ids|flags|timestamp|userid|user|size|comment|tags',
'rvlimit':'100'
}
req = api.APIRequest(site, params)
res = req.query(querycontinue=False)
allMembers.append(res)
with open('/Applications/MAMP/htdocs/python/wikipedia-1.4.0/data/wiki-leg.json', 'w') as outfile:
json.dump(allMembers, outfile, indent=2)