Wikipedia:Bots/Requests for approval/Legobot 18
- The following discussion is an archived debate. Please do not modify it. To request review of this BRFA, please start a new section at WT:BRFA. The result of the discussion was Approved.
Operator: Legoktm (talk · contribs · SUL · edit count · logs · page moves · block log · rights log · ANI search)
Time filed: 07:18, Tuesday August 14, 2012 (UTC)
Automatic, Supervised, or Manual: Automatic
Programming language(s): Python using Pywikipedia rewrite branch
Source code available: [1]
Function overview: Adds |oldid= to {{GA}} when missing
Links to relevant discussions (where appropriate): bot request
Edit period(s): Daily
Estimated number of pages affected: 20/week?
Exclusion compliant (Yes/No): Yes
Already has a bot flag (Yes/No): Yes
Function details:
- Fetches Category:Good articles without an oldid
- Iterates through the version history and finds which edit added {{good article}}.
- Updates the talk page accordingly.
Discussion
editAn example edit (which I meant to make under my account). LegoKontribsTalkM 07:18, 14 August 2012 (UTC)[reply]
A few code comments, since you posted a link and I'm procrastinating :
while not foundOldid:
fetch += 10
hist = page.fullVersionHistory(total=fetch)
This seems wrong. Taking a quick look in pywikipedia, it doesn't seem that page.fullVersionHistory even takes a "total" parameter (it seems to have "revCount" instead). And if it did this would probably fetch history entries 1–10, then 1–20, then 1–30, and so on rather than 1–10, 11–20, 21–30, and so on.
search = re.search('\{\{GA(.*?)\}\}', oldtext)
Note this will match all templates in Special:PrefixIndex/Template:GA, not just {{GA}}
, and has various other issues that are less likely to be troublesome for this particular template. Anomie⚔ 16:20, 14 August 2012 (UTC)[reply]
- I probably should have specified up there, but I'm using a custom flavor of the pywikipedia rewrite branch, not the standard release. But the
fetch += 10
part was wrong. I modified fullVersionHistory so I can specify the oldid to start fetching from. I also changed the regex to\{\{GA\|(.*?)\}\}
so it should only match{{GA}}
. Thanks, LegoKontribsTalkM 23:10, 14 August 2012 (UTC)[reply] {{BAGAssistanceNeeded}}
LegoKontribsTalkM 05:20, 23 August 2012 (UTC)[reply]- Approved for trial (24 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. – Go ahead and clear out the category. — madman 04:19, 25 August 2012 (UTC)[reply]
- Trial complete. Edits are in the latest contributions, all of the oldids the bot found were correct when I reviewed them. LegoKontribsTalkM 04:42, 25 August 2012 (UTC)[reply]
- Approved. — madman 05:16, 25 August 2012 (UTC)[reply]
- Trial complete. Edits are in the latest contributions, all of the oldids the bot found were correct when I reviewed them. LegoKontribsTalkM 04:42, 25 August 2012 (UTC)[reply]
- Approved for trial (24 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. – Go ahead and clear out the category. — madman 04:19, 25 August 2012 (UTC)[reply]
- The above discussion is preserved as an archive of the debate. Please do not modify it. To request review of this BRFA, please start a new section at WT:BRFA.