2 Prints the reverting rev_id, rev_id and reverted to rev_id of all reverted
3 revisions made by user "PermaNoob".
5 from mw.api import Session
6 from mw.lib import reverts
8 session = Session("https://en.wikipedia.org/w/api.php")
9 revisions = session.user_contribs.query(user={"PermaNoob"}, direction="newer")
12 revert = reverts.api.check_rev(session, rev, window=60*60*24*2)
13 if revert is not None:
14 print("{0} reverted {1} to {2}".format(
15 revert.reverting['revid'],
17 revert.reverted_to['revid'])