I ended up adapting `preloadpages` from site.py by removing the loading of revision content (and a couple of other things I didn't need), and the github link now points to the latest commit where those changes are incorporated.
Cheers, M On 7 April 2016 at 16:33, Morten Wang <[email protected]> wrote: > Hey all, > > I'm working on extending the pywikibot.Page object to add methods to get > an article's assessment rating, predicted rating (through ORES[1]), and > number of page views (through the page view API). SuggestBot uses these > three pieces of information when posting suggestions on the English > Wikipedia. > > I have preliminary code that works[2], and am now trying to extend it with > a couple of generators and bulk loading to increase efficiency. Assessment > ratings are grabbed from talk pages, so that part appears straightforward. > ORES uses revisions IDs, however, so I'm looking for an efficient way to > get "lastrevid" for a list of pages (pywikibot.Page objects). > > I can use a PreloadingGenerator for it, as that sets `_revid`, but since I > don't need the page content that seems excessive. Modifying the > `preloadpages` method from site.py is of course possible, but perhaps > there's another alternative here? > > References: > 1: https://meta.wikimedia.org/wiki/Objective_Revision_Evaluation_Service > 2: > https://github.com/nettrom/suggestbot/blob/newpopqual/suggestbot/utilities/page.py > > > Cheers, > Morten > >
_______________________________________________ pywikibot mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/pywikibot
