]> code.communitydata.science - rises_declines_wikia_code.git/blob - mediawiki_dump_tools/Mediawiki-Utilities/examples/api.users.py
add copy of the GPL
[rises_declines_wikia_code.git] / mediawiki_dump_tools / Mediawiki-Utilities / examples / api.users.py
1 """
2 Prints the rev_id, characters and hash of all revisions to User:EpochFail.
3 """
4 import os
5 import sys
6
7 try:
8     sys.path.insert(0, os.path.abspath(os.getcwd()))
9     from mw import api
10 except:
11     raise
12
13 api_session = api.Session("https://en.wikipedia.org/w/api.php")
14
15 user_docs = api_session.users.query(
16     users=["EpochFail", "Halfak (WMF)"]
17 )
18
19 for user_doc in user_docs:
20     print(user_doc)

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