Page MenuHomePhabricator

Revision history does not have size parameter
Closed, ResolvedPublicFeature

Description

Media Wiki API has parameter to fetch the size of each revision history.
But the drawback is that only 500 entries can be fetched at once.

Pywikibot allows us to scrap all revision history data at once using Page.revisions()
but there is no parameter to get the size.

Event Timeline

Xqt triaged this task as Medium priority.
Xqt changed the subtype of this task from "Bug Report" to "Feature Request".

see an old implementation in rPWBC06103d9ca78f but just WIP. I'll try to update it soon.

Change 341342 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [WIP][IMPR] rewrite Revision class

https://gerrit.wikimedia.org/r/341342

@PythonMonster: The path above is still WIP but you can try an review it. The size and some other data is provided either as attribute or as item, e.g.

>>> import pwb, pywikibot as py
>>> s = py.Site()
>>> p = py.Page(s, 'user:xqt/Test')
>>> g = p.revisions(content=True, total=1)
>>> d = next(g)
>>> d.size
18
>>> d['size']
18

Change 341342 merged by jenkins-bot:
[pywikibot/core@master] [IMPR] rewrite Revision class

https://gerrit.wikimedia.org/r/341342