Automatic or Manually Assisted: Automatic, unsupervised
Programming Language(s): Perl
Function Overview: Remove the deprecated website
, imdb_id
, and amg_id
parameters from instances of {{
Infobox Film}}, while adding the links those parameters formerly generated to the article's External links section.
Edit period(s): One-time run.
Already has a bot flag (Y/N): Y
Function Details: Per
request, the bot will load all pages containing {{
Infobox Film}}. Any website
, imdb_id
, or amg_id
parameters will be removed, and {{
official}}, {{
imdb title}}, or {{
amg movie}} (respecively) will be added to the article's External links section if that section does not already contain the corresponding link. An External links section will be created if necessary. Any issues encountered will be logged to
User:AnomieBOT/TemplateReplacer13 log. Each page will only be processed once (a local database holds the pageids of all successfully-processed pages).
The only real "fun" part here is determining where exactly the article ends and the navboxes/stub templates begin (cats and interlanguage links are trivial). The approach taken here is to consider any line containing only templates, categories, interlanguage links, and/or comments to be part of the "end junk", with a list of specific templates likely to be false positives (e.g. {{
reflist}} and templates for various sister project boxes). The new links are inserted at the top of the section if website
is being moved, or else after any existing
film external link template, or else at the end of the section (but still above navboxes etc) if all else fails. Source is at
User:AnomieBOT/source/tasks/TemplateReplacer13.pm.
FYI, there will be several thousand page edits (just the imdb_id
parameters needing links is apparently over 6000 pages). I can easily limit edits to only those pages that actually need external links added (many already have the infobox links present in the external links section); all it takes is changing one flag to limit it or not.
Anomie
⚔ 03:41, 23 February 2009 (UTC)
reply