]> code.communitydata.science - rises_declines_wikia_code.git/blob - mediawiki_dump_tools/Mediawiki-Utilities/examples/api.py
add copy of the GPL
[rises_declines_wikia_code.git] / mediawiki_dump_tools / Mediawiki-Utilities / examples / api.py
1 """
2 Prints the rev_id of all revisions to User:EpochFail.
3 """
4 import sys
5 import os
6
7 sys.path.insert(0, os.path.abspath(os.getcwd()))
8
9 from mw import api
10
11 api_session = api.Session("https://en.wikipedia.org/w/api.php")
12
13 revisions = api_session.revisions.query(
14     properties={'ids'},
15     titles={'User:TestAccountForMWUtils'}
16 )
17
18 for rev in revisions:
19     print(rev['revid'])

Community Data Science Collective || Want to submit a patch?