1
0

Initial commit

p#	new file:   runwikiq.sh
This commit is contained in:
2018-06-02 15:32:19 -07:00
commit 72633c193b
202 changed files with 21929 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
"""
Prints the rev_id, characters and hash of all revisions to User:EpochFail.
"""
import sys
import os
sys.path.insert(0, os.path.abspath(os.getcwd()))
import hashlib
from mw import api
api_session = api.Session("https://en.wikipedia.org/w/api.php")
revisions = api_session.revisions.query(
properties={'ids', 'content'},
titles={"User:EpochFail"},
direction="newer",
limit=51
)
for rev in revisions:
print(
"{0} ({1} chars): {2}".format(
rev['revid'],
len(rev.get('*', "")),
hashlib.sha1(bytes(rev.get('*', ""), 'utf8')).hexdigest()
)
)