[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pywikipediabot-users
Subject:    Re: [pywikibot] Efficient loading of last revision ID for pages
From:       Morten Wang <nettrom () gmail ! com>
Date:       2016-04-09 20:17:07
Message-ID: CALkHm5Bz5JHXMwZ=feNtMrq+NFivqtbZzrsHTx9AE9COzYdYHA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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 <nettrom@gmail.com> 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
>
>

[Attachment #5 (text/html)]

<div dir="ltr">I ended up adapting `preloadpages` from site.py by removing the \
loading of revision content (and a couple of other things I didn&#39;t need), and the \
github link now points to the latest commit where those changes are \
incorporated.<div><br></div><div><br></div><div>Cheers,</div><div>M</div></div><div \
class="gmail_extra"><br><div class="gmail_quote">On 7 April 2016 at 16:33, Morten \
Wang <span dir="ltr">&lt;<a href="mailto:nettrom@gmail.com" \
target="_blank">nettrom@gmail.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr">Hey all,<div><br></div><div>I&#39;m working on \
extending the pywikibot.Page object to add methods to get an article&#39;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.</div><div><br></div><div>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&#39;m \
looking for an efficient way to get &quot;lastrevid&quot; for a list of pages \
(pywikibot.Page objects).</div><div><br></div><div>I can use a PreloadingGenerator \
for it, as that sets `_revid`, but since I don&#39;t need the page content that seems \
excessive. Modifying the `preloadpages` method from site.py is of course possible, \
but perhaps there&#39;s another alternative \
here?</div><div><br></div><div>References:</div><div>1:  <a \
href="https://meta.wikimedia.org/wiki/Objective_Revision_Evaluation_Service" \
target="_blank">https://meta.wikimedia.org/wiki/Objective_Revision_Evaluation_Service</a></div><div>2: \
<a href="https://github.com/nettrom/suggestbot/blob/newpopqual/suggestbot/utilities/page.py" \
target="_blank">https://github.com/nettrom/suggestbot/blob/newpopqual/suggestbot/utili \
ties/page.py</a></div><div><br></div><div><br></div><div>Cheers,</div><div>Morten</div><div><br></div></div>
 </blockquote></div><br></div>


[Attachment #6 (text/plain)]

_______________________________________________
pywikibot mailing list
pywikibot@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic