Wikipedia:Bots/Requests for approval/TokenzeroBot
- 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: Tokenzero (talk · contribs · SUL · edit count · logs · page moves · block log · rights log · ANI search)
Time filed: 22:05, Saturday, October 7, 2017 (UTC)
Automatic, Supervised, or Manual: Automatic
Programming language(s): Python, pywikibot
Source code available: github (most of it is around making reports, fixPageRedirects() is the most relevant here).
Function overview: Automate creation and fixing of redirects from ISO 4 abbreviation to academic journals (see Category:Articles with missing ISO 4 redirects).
Links to relevant discussions (where appropriate): Replacing Mdann52 bot 13, as agreed here.
Edit period(s): one time run
Estimated number of pages affected: a few thousand redirects
Namespace(s): Mainspace
Exclusion compliant (Yes/No): Yes
Function details:
- Go through all pages that include an {{infobox journal}} (~7500 pages, possibly many IJs per page), retrieve
|abbreviation=J. Foo.
from each IJ. - Check if it is equal to the abbreviation computed by the automatic tool. If not, do nothing. If equal:
#REDIRECT [[Article containing Infobox journal]] {{R from ISO 4}}
- If the redirect page already exists, replace it under the following conditions:
- It is not already just a simple variation (whitespace, {{R printworthy}}, {{Redirect category shell}}, synonyms);
- It has a redirect to the page we came from (eg. do not replace redirects to a specific section or a disambiguation page);
- It contains nothing but the redirect, at most one single rcat (from abbrev or from spelling) without parameters, and simple variations (as above). Eg. do not change if it contains {{R from move}}.
- If the redirect page already exists, replace it under the following conditions:
- If J. Foo. (dotted redirect) already exists and is tagged with {{R from ISO 4}}, create/replace the dottless redirect J Foo as above (regardless of the automatic tool).
Discussion
[edit]A partial log from a simulated run is available here. I also checked any changes that wouldn't fit the most obvious patterns. I've considered removing the rcat {{R from ISO 4}} from redirects that are not ISO 4, like Nat., but this is hard to decide (eg. they might be valid for some former titles), so instead I'll just make a list of them later. Tokenzero (talk) 22:05, 7 October 2017 (UTC)[reply]
- I highly support this. Someone from BAG should close/deny Wikipedia:Bots/Requests for approval/Mdann52 bot 13, and get this one to trial. I would, but I'm involved here. Headbomb {t · c · p · b} 21:47, 8 October 2017 (UTC)[reply]
- Approved for trial (50 days). Please provide a link to the relevant contributions and/or diffs when the trial is complete.—CYBERPOWER (Chat) 13:45, 9 October 2017 (UTC)[reply]
- Trial complete. See contribs. The first half was marked as "minor" edits, because I didn't realize this was the default in pywikibot. I've also noticed the Cell Cycle redirect to Cell Cycle (journal). This is the correct ISO 4 abbreviation, since both words are unabbreviated according to the LTWA list. But the redirect should perhaps be avoided because Cell cycle (with different capitalization) exists (and unsurprisingly links to the redirect are inconsistent). To avoid creating new ones like this I've added a check to skip trivial abbreviations (i.e. with all words kept unabbreviated or omitted altogether as articles/prepositions). Tokenzero (talk) 22:56, 10 October 2017 (UTC)[reply]
- Approved.—CYBERPOWER (Around) 19:35, 11 October 2017 (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.