Jump to content

Wikipedia:Bots/Requests for approval/TokenzeroBot

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Tokenzero (talk | contribs) at 22:09, 7 October 2017 (TokenzeroBot: new BRFA, for journal abbrev redirects). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

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:
    • Create a redirect at J. Foo. and J Foo (dotted and dotless).
#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 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

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]