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:
An example edit (which I meant to make under my account). Lego Kontribs TalkM 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
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,
Lego
Kontribs
TalkM 23:10, 14 August 2012 (UTC)
reply{{
BAGAssistanceNeeded}}
Lego
Kontribs
TalkM 05:20, 23 August 2012 (UTC)
reply