Wikipedia:Bots/Requests for approval/WOSlinkerBot 16
- The following discussion is an archived debate. Please do not modify it. To request review of this BRFA, please start a new section at Wikipedia:Bots/Noticeboard. The result of the discussion was Approved.
New to bots on Wikipedia? Read these primers!
- Approval process – How this discussion works
- Overview/Policy – What bots are/What they can (or can't) do
- Dictionary – Explains bot-related jargon
Operator: WOSlinker (talk · contribs · SUL · edit count · logs · page moves · block log · rights log · ANI search)
Time filed: 18:58, Monday, November 8, 2021 (UTC)
Function overview: Fix pages with the fostered content lint issue.
Automatic, Supervised, or Manual: Automatic
Programming language(s): Javascript
Source code available: At User:WOSlinkerBot/linttask16.js
Links to relevant discussions (where appropriate):
Edit period(s): one time run
Estimated number of pages affected: 1300 with fostered issues and 650 with code tag nesting issues (some overlap, so total will be lower)
Namespace(s): User & User talk
Exclusion compliant (Yes/No): No
Function details: Fix various lint issues with fostered content on user talk pages as below:
- Check out some of these pages, 683 pages
- Time Travel, 21 pages
- Created by Sahibdin or Bellus Delphina, 111 pages
- Bangla Wikipedia Photography Contest, 212 pages
- Ichthus December 2019, 313 pages
- Ichthus January 2020, 311 pages
- Nuvola apps edu mathematics blue-p.svg, 86 pages
- code tag nesting, 658 pages
Discussion
[edit]- I took a look at the examples and saw they have some other Lint errors too. They can be fixed in the same edit by adding more regexes -
- Check out some of these pages: misnested code tags
myContent = myContent.replace(/(<code>)\n(<nowiki>\=\=References\=\=<\/nowiki>)(\n<br \/>\n)(<nowiki>\{\{Reflist\}\}<\/nowiki>)\n(<\/code>)/gi,'$1$2$5$3$1$4$5');
myContent = myContent.replace(/(<code>)\n(<nowiki>\{\{Refbegin\}\}<\/nowiki>)(\n<br \/>\n)(<nowiki>\*Press paste \(Ctrl\+V or Apple\+V\) after this asterisk, then remove the <ref><\/ref> tags<\/nowiki>)\n<br \/>\n(<nowiki>\{\{Refend\}\}<\/nowiki>)\n(<\/code>)\}\}/gi,'$1$2$6$3$1$4$6$3$1$5$6\n}}');
- Created by Sahibdin: html5 misnesting, misnested, stripped and obsolete html tags
myContent = myContent.replace(/<center><span style\=\"font-family\: Arial\; font-size\: 12pt\"><font size\=\"18\">(WikiProject India)<\/center><\/font><\/span>/gi,'<div style="text-align:center; font-family:Arial; font-size:xxx-large;">$1</div>');
myContent = myContent.replace(/(opt-out of future mailings\.<\/small>\}\}\n<\/div>\n)<\/div>(--\[\[User\:MediaWiki message delivery\|MediaWiki message delivery\]\])/gi,'$1$2');
- This seems to have a large overlap with this pattern which also has fostered content and obsolete html tag errors that can be fixed using -
myContent = myContent.replace(/<table>(<small> Created by \{\{noping\|Bellus Delphina\}\} <\/small>)<\/table>/gi,'$1');
myContent = myContent.replace(/<center><span style\=\"font-family\: Arial\; font-size\: 12pt\"><font size\=\"18\">(WikiProject India)<\/font><\/span><\/center>/gi,'<div style="text-align:center; font-family:Arial; font-size:xxx-large;">$1</div>');
- Ichthus December 2019: obsolete html tags
myContent = myContent.replace(/(-----\n)<center>(\n<div style\=\"font-family\:Bebas Neue\;font-size\: 25px\;\">\'\'\'Quotes\'\'\'<\/div>)/gi,'$1<div class="center">$2');
myContent = myContent.replace(/(illustrator and social critic\.)<\/center>(<\/div>)/gi,'$1</div>$2');
myContent = myContent.replace(/<center>(\[\[WP\:X\|<span style\=\"font-family\: Bebas Neue \; color\:\#1B1C1B\; font-size\: 14pt\">\'\'\'WikiProject Christianity)/gi,'<div class="center">$1');
myContent = myContent.replace(/(Full_content_delivery\|Unsubscribe\]\]<br>Delivered\: [0-9]+\:[0-9]+, [0-9]+ [A-Za-z]+ [0-9]+ \(UTC\)<\/small>)<\/center>/gi,'$1</div>');
- Ichthus January 2020: The regex you are currently using (line no. 38) preserves obsolete html tags, it can be replaced with
myContent = myContent.replace(/<table width\=\"450\" border\=\"0\" cellspacing\=\"0\" cellpadding\=\"0\" align\=\"center\">\n<center>\n<span style\=\"font-family\: Bebas Neue \; color\:\#ffffff\; font-size\:56pt\;text-align\:center\;\"><p>(\{\{underline\|\'\'\'<big>I<\/big>CHTHUS\'\'\'\}\})<\/p><\/span><\/center>\n<\/table>/gi,'<div style="text-align:center; font-family:Bebas Neue; color:#ffffff; font-size:56pt;">$1</div>');
- In addition, this has 3 missing end and 3 obsolete html tags that can be fixed using -
myContent = myContent.replace(/(which drives a wedge into the world of false assurances\.\")(<br>\n)(~ \[\[Jacques Ellul\]\]\'\'\'<\/div>)/gi,'$1\'\'\'$2\'\'\'$3');
myContent = myContent.replace(/(and may it be sprinkled with love and friendship\.\'\')(<br>\n\'\'\'\'\'Best Wishes\!)/gi,'$1\'\'\'$2');
myContent = myContent.replace(/<center>(\n<div style\=\"font-family\:Bebas Neue\;font-size\: 25px\;\">\'\'\'Quotes\'\'\'<\/div>)/gi,'<div class="center">$1');
myContent = myContent.replace(/(\{\{Wikiquote-inline\|Jacques Ellul\}\} )<\/center>(<\/div>)/gi,'$1$2$2');
myContent = myContent.replace(/<center>(\[\[WP\:X\|<span style\=\"font-family\: Bebas Neue \; color\:\#1B1C1B\; font-size\: 14pt\">\'\'\'WikiProject Christianity)/gi,'<div class="center">$1');
myContent = myContent.replace(/(Outreach\/Full_content_delivery\|Unsubscribe\]\]<\/small>)<\/center>/gi,'$1</div>');
myContent = myContent.replace(/<center>(<small>Sent by \[\[User\:MediaWiki message delivery\|MediaWiki message delivery\]\] \(\[\[User talk\:MediaWiki message delivery\|talk\]\]\) 21\:27, 4 January 2020 \(UTC\)<\/small>)<\/center>/gi,'{{center|$1}}');
- I have tested only the replacements, not the regexes. ಮಲ್ನಾಡಾಚ್ ಕೊಂಕ್ಣೊ (talk) 07:05, 9 November 2021 (UTC)[reply]
- Check out some of these pages: misnested code tags
- Thanks for the comments, I've added in the changes for other lint issues, apart from the center tag which I'm not inclined to do. -- WOSlinker (talk) 18:17, 9 November 2021 (UTC)[reply]
- Approved for trial (40 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. Please do 5 replacements for each issue. Primefac (talk) 11:58, 11 November 2021 (UTC)[reply]
- Trial complete. Have done the following edits. -- WOSlinker (talk) 17:53, 11 November 2021 (UTC)[reply]
- Approved for trial (40 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. Please do 5 replacements for each issue. Primefac (talk) 11:58, 11 November 2021 (UTC)[reply]
- Check out some of these pages & code tag nesting, 5 edits (However, there was an issue with this edit missing the closing table, so I updated the script and did this edit to fix that.)
- Time Travel, 5 edits
- Created by Sahibdin or Bellus Delphina, 5 edits
- Bangla Wikipedia Photography Contest, 5 edits
- Ichthus December 2019 & 2020, 5 edits
- Nuvola apps edu mathematics blue-p.svg, 5 edits
Approved. Primefac (talk) 11:05, 16 November 2021 (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 Wikipedia:Bots/Noticeboard.