Wikipedia:Bot requests

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

This is a page for requesting tasks to be done by bots per the bot policy. This is an appropriate place to put ideas for uncontroversial bot tasks, to get early feedback on ideas for bot tasks (controversial or not), and to seek bot operators for bot tasks. Consensus-building discussions requiring large community input (such as request for comments) should normally be held at WP:VPPROP or other relevant pages (such as a WikiProject's talk page).

You can check the "Commonly Requested Bots" box above to see if a suitable bot already exists for the task you have in mind. If you have a question about a particular bot, contact the bot operator directly via their talk page or the bot's talk page. If a bot is acting improperly, follow the guidance outlined in WP:BOTISSUE. For broader issues and general discussion about bots, see the bot noticeboard.

Before making a request, please see the list of frequently denied bots, either because they are too complicated to program, or do not have consensus from the Wikipedia community. If you are requesting that a template (such as a WikiProject banner) is added to all pages in a particular category, please be careful to check the category tree for any unwanted subcategories. It is best to give a complete list of categories that should be worked through individually, rather than one category to be analyzed recursively (see example difference).

Alternatives to bot requests

Note to bot operators: The {{BOTREQ}} template can be used to give common responses, and make it easier to keep track of the task's current status. If you complete a request, note that you did with {{BOTREQ|done}}, and archive the request after a few days (WP:1CA is useful here).


Please add your bot requests to the bottom of this page.
Make a new request


Removing anonblock and similar templates from IP talk pages where the IP is not currently blocked[edit]

I know this might sound crazy, but I've been thinking of a bot task where a bot would check for IPs that are not currently blocked with templates such as Template:Anonblock and Template:School block on their talk pages and then remove them. This is because it might confuse an IP user to be told that their IP is blocked even though they're not blocked, and the template is in present tense (ex. "your school, library, or educational institution's IP address is blocked") and it would be weird for that to be on an IP which is not currently blocked wizzito | say hello! 23:42, 14 February 2022 (UTC)[reply]

See also {{Rangeblock}}, which uses the wording "has been blocked", which is ambiguous as to whether the block has ended. Certes (talk) 00:08, 15 February 2022 (UTC)[reply]
Doing... 🐶 EpicPupper (he/him | talk) 21:52, 15 February 2022 (UTC)[reply]
Oops, this fell into my black hole of tasks. Looking into it again. 🐶 EpicPupper (he/him | talk) 00:28, 8 April 2022 (UTC)[reply]
Welcome to the black hole of user talk pages. I'm not here to discourage any attempts to look into this, but I just want to make a couple of observations. The schoolblock template has a namespace check - when shown for a blocked edit it is typically current tense, but when shown on user talk pages it uses 'may be'. The anonblock template also uses 'may be', but at all times. In most cases anon users will never visit their talk page anyway, but these templates do serve the purpose of providing generally good standing advice for good faith school users - they probably should create an account while they can. One should probably check for range blocks, and these templates are sometimes used as a block notification just like any other block message. I can give an example showing both these latter issues: User talk:168.169.188.9. -- zzuuzz (talk) 00:59, 8 April 2022 (UTC)[reply]

Bot to maintain lists of Wikipedians by good article/featured article views[edit]

As much as we preach against it, climbing up the ranking in a list remains a strong motivator for many Wikipedians. WP:WBGAN and WP:WBFAN list out Wikipedians by their number of good articles or featured articles, but I think it might be a better measure of impact (albeit still an imperfect one) to instead list out Wikipedians by the cumulative annual views of all their GAs or FAs. Would anyone be interested in coding a bot to maintain such lists? {{u|Sdkb}}talk 22:58, 22 March 2022 (UTC)[reply]

When users are making FA for reasons other than improving Wikipedia it can create trouble. Over at WP:MOSTARTICLES, the top 100 were scrambled to derail certain users who were using their standings for off-wiki benefit. Imagine the press runs a story linking to the list, unscrupulous users create bots to drive up page hit counts in order to gain personal fame and notoriety, to compete, or for egotistical reasons. -- GreenC 00:54, 23 March 2022 (UTC)[reply]
I think we need to strike a balance. If our goal was to never present any information that could ever be gamed, we wouldn't have WBGAN/WBFAN, nor would we even allow things like Barnstars. Is it possible someone would abuse the system by creating pageview bots as you theorize? Sure, but it doesn't seem super likely to me, whereas the value of these lists to push editors toward improving articles that need it more seems much more plausible. Looking at it another way, we already have lists that measure impact poorly and are extremely easily gamed (e.g. by churning out boilerplate typhoon FAs)—what I'm seeking here is to create lists that are marginally better. {{u|Sdkb}}talk 01:08, 23 March 2022 (UTC)[reply]
Wouldn't it encourage low-effort FA creation, since cumulative views would increase when you have a large number of FA. Alt idea: measure the rate of change in views from before FA to post-FA. For example average views in the 5-year period before FA vs. average views post FA. This has the benefit of being neutral to minor topics that don't normally attract many views anyway, since it's measuring ratio not absolute count. That way obscure topic areas (Carolingian Empire) are not listed lower than high traffic topics (TV series), even though the former may have had a greater impact on page views percentage wise. GreenC 04:57, 23 March 2022 (UTC)[reply]
The current WBFAN page is what encourages low-effort FA creation; this could only improve on that. On view change, there's nothing intrinsically about making an article an FA that increases its views. What can increase its views is linking to it more elsewhere, and while I've come across some egregiously underlinked FAs, I've also come across some FA authors who want to link to their page from everywhere, whether warranted or not. So if you're worried about perverse incentives, I think the alt idea is the one to fear.
And on prioritizing high-traffic topics, yes, that's the point. We're writing an encyclopedia for readers, so we should want to focus more on the articles they actually read. Not exclusively—plenty of VAs aren't super popular—but weighting only by viewcount is better than not weighting at all. The Bus Uncle and Earth just plainly aren't equally important, and a page that counts them both as one star isn't measuring impact well.
I hope that helps clarify why I'd like to see these lists. If you're not convinced, though, that's genuinely fine—they're just lists in project space, so you'll be free to ignore them in favor of other pages that you prefer. Best, {{u|Sdkb}}talk 06:23, 23 March 2022 (UTC)[reply]
In terms of implementation, for the GA side, the hardest part is mapping articles to nominators (which involves some tricky digging through diffs and munging wikitext). This is already implemented by User:SDZeroBot, the bot that populates WP:WBGAN. So the easiest route would be to ideally reuse their code for that purpose, or even see if the maintainer is willing to implement it using their existing code. The additional work of fetching pageview totals for each page is quite simple using the Mediawiki Pageviews API. One thing to keep in mind is that the distribution of pageviews has a very heavy tail, so even if a user has nominated many GAs or FAs, their total pageviews will probably be dominated by their one or two most popular articles. (For example, I've started around 60 articles. The most popular of those articles - Cow Tools - gets about as many pageviews as all the others combined.) Colin M (talk) 18:14, 25 March 2022 (UTC)[reply]
Thanks for the thoughts, Colin! @SD0001, one simple way to do this might be to just add a "total annual views" column to the table your bot already produces at WBGAN. Would something like that be easy to code, and if so, would it be of interest? {{u|Sdkb}}talk 18:31, 25 March 2022 (UTC)[reply]
I think it's better to put it on a separate page. I'm afraid I don't have the time though, but as mentioned below it should be pretty straightforward to do for a different bot operator if the existing article->nominator database is used. – SD0001 (talk) 20:22, 25 March 2022 (UTC)[reply]
@SD0001, just curious, why do you think it'd be better on a separate page? Thinking about it, having it on the same page people are already visiting might be best. {{u|Sdkb}}talk 05:04, 10 April 2022 (UTC)[reply]
No need to reuse the code (that would be quite involved!) – SDZeroBot maintains the public s54328__goodarticles_p database on toolforge (table name: nominators2) containing the article–nominator mapping, which is updated in real-time. Then to update WBGAN everyday, it simply queries this table. This has been running for more than a year now and has been quite stable. – SD0001 (talk) 20:17, 25 March 2022 (UTC)[reply]

Bot to help with GAR closures[edit]

Closing a GAR discussion is quite a bit of faff, so I hope on of the magicians technical editors could help us out. A bot would have to do the following:

  1. remove the {{GAR/link}} from the article talk page
  2. update the {{article history}}, or change the {{GA}} template into article history it when not yet present, like this diff
  3. remove the GA status from WikiProjects banners if delisted
  4. remove the good article template from the article if delisted
  5. remove the good article from the list of good articles if delisted
  6. archive the discussion (if a community assessment). The current archive is found at Wikipedia:Good article reassessment/Archive 67. As a bonus, the bot could make a new archive whenever the previous one is full. This is now done manually (see Wikipedia talk:Good article reassessment/Maintenance)

I think the FACBot is already doing something very similar for featured articles. For a community assessment, this bot could be triggered when the discussion is closed (and {{GAR/current}} on the reassessment page is changed to {{GAR/result}}). For individual assessments the most logical trigger would be the removal of the {{GAR/link}} from the article talk page. In that case, the bot would start from #2. Pinging @Aircorn, who is doing a lot of this maintenance. Femke (talk) 07:27, 10 April 2022 (UTC)[reply]

Howdy. NovemBot 1 does something similar for good topic promotions and featured topic promotions. I could reuse its code for turning {{GA}} into {{Article history}}. Can you provide a link to 1 recent individual assessment closure and 1 recent community assessment closure for me to review? Also, are you open to having a limited list of people who can summon the bot for security reasons, or does it need to be summonable by anyone? –Novem Linguae (talk) 21:46, 10 April 2022 (UTC)[reply]
Brilliant!
A link to a and example for an individual delisting and a community reassessment closure. Individual reassessments are done by quite a large group of people, so I think it would be preferable to have it summonable by anyone. (Community reassessment closures are done by a smaller group). Femke (talk) 16:38, 11 April 2022 (UTC)[reply]
Sounds good. Next time you close a couple of these, can you just say "approved for delisting" and ping me and leave the checklist to me so I can practice a bit? Once I'm comfortable with the procedure then I'll start writing some code. –Novem Linguae (talk) 02:10, 12 April 2022 (UTC)[reply]
Thanks for the ping. Femke seems to have covered everything so I will just add that this would be really useful. Aircorn (talk) 08:49, 12 April 2022 (UTC)[reply]
I just closed two discussions: Wikipedia:Good article reassessment/WIN Television/1 and Wikipedia:Good article reassessment/American popular music/1. Let me know if you'd like more practice / whether I should open an individual reassessment (so that it can be closed in a week if no-one responds). Femke (talk) 16:18, 13 April 2022 (UTC)[reply]
Done. 1, 2, work instruction I created. Please check those and let me know if everything looks good. If so, I'll begin writing a bot. I'll probably do the community process first. If we did a whitelist, how many people would we need to put on it? A whitelist would help with security concerns at the BRFA. –Novem Linguae (talk) 09:37, 14 April 2022 (UTC)[reply]
Everything looks good :).
I went back 2 years in the archives, and found around 20 people closing discussions; half of those only closed one discussion. So initially 20 people on a whitelist? Femke (talk) 16:08, 14 April 2022 (UTC)[reply]
I might end up doing the permissions check by having a summoning template ping the bot, then the bot can check for extended confirmed via who pings it. Looking like I'll be busy IRL for a couple of weeks. It's on my todo list. Feel free to follow up every once in awhile to keep me on track. –Novem Linguae (talk) 21:03, 22 April 2022 (UTC)[reply]
EC should cover basically everybody who would be interested in closing community GARS, so that should work. I hope this bot can be one of the puzzle pieces that make a new GA sweep initiative feasible (probably only of highly-visible articles, as there are just too many GAs). If an initiative like that were to become popular, it may attract one or two non-EC editors. Femke (talk) 16:04, 29 April 2022 (UTC)[reply]
How is it going? I assume it would be good to hold off on closing reviews once an BRFA is launched, so that we have enough test cases? Femke (talk) 18:02, 19 May 2022 (UTC)[reply]
Hey there. I'm going to be busy with my real world job for a couple weeks. Probably best to manually close your GARs. Once I get some time I can probably code most of this in a day, borrowing a lot of code from my other bot. Maybe ping me around June 7. Sorry for the delay. –Novem Linguae (talk) 23:40, 19 May 2022 (UTC)[reply]

GAN bot[edit]

As a note, this request is just for GAR, but if you could do something similar for GAN (new nominations) you'd be my new best friend. I can give you the steps required if this is something you could do. Best Wishes, Lee Vilenski (talkcontribs) 22:05, 10 April 2022 (UTC)[reply]
Sure. Happy to look into GAN promotion. Good idea on the steps, please share when you get a chance. –Novem Linguae (talk) 23:16, 10 April 2022 (UTC)[reply]
We already have a userscript to nominate GAs, so this is just for closing nominations. Looking at what this would take, it's probably better as a userscript. Here's what I've got - let me know if this is something you can do, or if there is something we can pass on to do elsewhere. Here's the list from WP:GANI:
Extended content
Passing

If you determine that the article meets the good article criteria, you may pass it by doing the following:

  1. Replace the {{GA nominee}} template on the article talk page with {{GA|~~~~~|topic=|page=}} or {{GA|~~~~~|subtopic=|page=}}
  2. The five tildes supply the date of the review. Fill in the |topic= and |page= number of the review by copying both parameter values from the replaced template. (The topic parameter refers to the topic values found here; the template automatically converts GA nominee subtopics into GA topics. The page parameter should be the number of the review subpage; that is, the n in {{Talk:ArticleName/GAn}} – a number only; no letters.)
  3. Update any {{WikiProject}} templates on the article talk page by changing the |class= parameter value to "GA", as in {{WikiProject|...|class=GA}}
  4. Save the page. A bot will add the good article icon to the article, will remove the nomination from the GA nominations page, and will use {{GANotice}} to let the nominator know that the article has passed. Do not add the icon manually unless the bot fails to function properly.
  5. Be sure the review page justifies how the article meets the good article criteria. You may also leave a personal note of congratulations for the nominator.
  6. List the article at Wikipedia:Good articles in the appropriate section.
Failing

If you determine that the article does not meet the good article criteria, you may fail it by doing the following:

  1. Replace the {{GA nominee}} template on the article talk page with {{FailedGA|~~~~~|topic=|page=}}
  2. The five tildes supply the date of the review. Fill in the |topic= and |page= number of the review by copying both parameter values from the replaced template. (The topic parameter refers to the topic values found here; the template automatically converts GA nominee subtopics into GA topics. The page parameter should be the number of the review subpage; that is, the n in {{Talk:ArticleName/GAn}} – a number only; no letters.)
  3. Save the page. A bot will remove the nomination from the GA nominations page and will use {{GANotice}} to let the nominator know that the article has failed.
  4. Be sure the review page specifies what needed to be done to the article for it to meet the good article criteria. You may also leave a personal note of encouragement for the nominator, urging them to renominate the article once the problems have been addressed.

I'd want a button, or instructions to add to the page for it to either pass, or fail. As far as I see it, passing requires:

  1. Replace the {{GA nominee}} template on the article talk page with {{GA|~~~~~|topic=|page=}} or {{GA|~~~~~|subtopic=|page=}}, topic/subtopic/page should already be filled in, so no need to change. This may also need to be the same {{Article History}} as above, which is quite confusing to do manually.
  2. Update class on {{WikiProject}} to GA.
  3. The big one is adding it to the suitable place on WP:GA. This is where I'd expect a userscript to be more beneficial, as it could list all of the places in this list, and where you should add the item. These are all in alphabetical order.

For a fail, it's simply just a case of changing {{GA nominee}} to {{Failed GA}}, or article history. Best Wishes, Lee Vilenski (talkcontribs) 14:53, 13 April 2022 (UTC)[reply]

Looks good. I can do this one. You OK with a timeframe of several weeks? I gotta juggle GAR bot above and some other stuff. Also, the next time you do a promotion or two, instead of doing the steps yourself, can you ping me so I can practice? –Novem Linguae (talk) 09:52, 14 April 2022 (UTC)[reply]
Sure. I've asked for a few different places, for a few years, so no drama. Anything you can get for me. I'll do a few reviews soon. Best Wishes, Lee Vilenski (talkcontribs) 10:42, 14 April 2022 (UTC)[reply]
Novem Linguae - mind closing Talk:Washington State Route 292/GA1 for me? Best Wishes, Lee Vilenski (talkcontribs) 12:24, 24 April 2022 (UTC)[reply]
I'll do another one, as I had to close that one. There were three edits involved with the closure, I can send diffs if this is also helpful. Best Wishes, Lee Vilenski (talkcontribs) 06:18, 26 April 2022 (UTC)[reply]
No worries. Yeah let's do another one when it's convenient. –Novem Linguae (talk) 06:22, 26 April 2022 (UTC)[reply]
Talk:Sora Amamiya/GA2 is to be closed. Best Wishes, Lee Vilenski (talkcontribs) 12:15, 9 May 2022 (UTC)[reply]
Alright, I closed that one and took some notes. The fact that sub-subtopics (example: Wikipedia:Good articles/Media and drama#Actors, directors, models, performers, and celebrities) are not indicated in the {{GA}} template is a bit tricky, we will probably need to have the user pick the correct category from a dropdown box. I will probably write a script that places a link in the more menu to decline a GA as a first milestone, and then after that I will move on to promote. Do you want the script to also atop the GA page? –Novem Linguae (talk) 06:27, 10 May 2022 (UTC)[reply]
Yeah, I think that's wise. Best Wishes, Lee Vilenski (talkcontribs) 06:31, 10 May 2022 (UTC)[reply]
FYI Firefly, who was planning to do a GAN bot at one point. * Pppery * it has begun... 21:06, 10 May 2022 (UTC)[reply]

Replace usbk template family with yy[edit]

There are some differences between the Template:Usbk associated templates and the Template:Yy associated templates. The differences are explained at Template:Yy. I designed the Yy series to add flexibility and functionality.
The simplest conversion involves the following:
  1. Replace all usbktop with yytop.
  2. Replace all usbk with yy.
  3. Replace all usbkbottom with yyend.
Since the Yy series has greater complexity than the Usbk series, this simple replacement may cause very long pages to overflow. In that case the page may need to be broken into two pages. Check the page for any errors before proceeding to the next page. Feel free to contact me if you have any questions. Yours aye,  Buaidh  talk e-mail 23:45, 26 April 2022 (UTC)[reply]
Thanks for the explanation. Would still be great to get the answers to my original 4 questions (diff? how many pages affected? is it a cosmetic edit? does it have consensus?), or at least a diff. Hard to proceed without this information. –Novem Linguae (talk) 02:34, 27 April 2022 (UTC)[reply]
Template:Usbk is found on 1,859 pages and Template:Yy is found on 10,290 pages. It is a functional change rather than a cosmetic change. It is a consensus only by greater use. See me if you have any more questions. Yours aye,  Buaidh  talk e-mail 03:30, 29 April 2022 (UTC)[reply]
Here's a DIFF. Wikipedia:Userboxes/Sports/Football/UEFA/Germany oldid=1084671230 and Wikipedia:Userboxes/Sports/Football/UEFA/Germany.  Buaidh  talk e-mail 03:45, 29 April 2022 (UTC)[reply]
I think I'm going to be busy for about a month or so. In the interest of not holding this up, moving it to WP:BOTREQ. Hope that helps. –Novem Linguae (talk) 05:30, 29 April 2022 (UTC)[reply]
P.S. This may need a WP:TFD to establish consensus for merging. –Novem Linguae (talk) 05:32, 29 April 2022 (UTC)[reply]
@Buaidh, I'm up for this. It should be doable with a few regexps, though I'd prefer if stronger consensus could be found, as Novem Linguae says above ― Qwerfjkltalk 06:19, 29 April 2022 (UTC)[reply]
We could just replace Usbk with Yy as deemed appropriate. As the author of Yy my intention was not to replace Usbk wholesale, but only where additional functionality was needed. Usbk is more compact than Yy and can be used where breaking a page in two is not warranted. Yy is prettier than Usbk, but that alone is not justification for replacing Usbk. Yours aye,  Buaidh  talk e-mail 21:06, 30 April 2022 (UTC)[reply]
This looks like a request to merge the usbk templates into the yy templates. That discussion should happen at TFD, unless I am misunderstanding the request. – Jonesey95 (talk) 13:16, 2 May 2022 (UTC)[reply]

Film categories[edit]

A few weeks ago per Wikipedia talk:WikiProject Film/Archive 79#Should "films by country" categories remain all-inclusive?, WikiProject Film reached a consensus to deprecate its former practice of deeming the base "[Country] films" categories to be "all-inclusive" (i.e. directly including all films from that country even if they were already otherwise subcategorized for genre or other characteristics.) However, some of the involved categories literally have thousands of articles, and there are nearly 200 country categories cross-referenced with a few dozen genre categories to deal with — so needless to say, we'd prefer to get as much of it as possible done by bot instead of editors having to manually go through over 100,000 films one at a time.

The important complications here are that there may be some films lurking in the base "Country films" categories which have not been fully subcategorized by genre at all yet, and some country-genre intersections may still be missing entirely — so the request would be for a bot to go through the Country-Genre intersection categories (e.g. Category:American documentary films, Category:British drama films, Category:Canadian short films, etc.) to remove "Country films" from films that are already subcategorized, but the bot should not be turned loose directly on "Country films" categories themselves, so that any unsubcategorized stragglers don't get stranded from the tree. Human editors can look after whatever cleanup is still necessary after a bot's done the grunt work, but we'd prefer to automate as much of the grunt work as possible first. Bearcat (talk) 15:52, 5 May 2022 (UTC)[reply]

Note: Category:Films by country contains all the Country/Genre intersection subcats:

Films by country by genre‎
Films by genre by country‎
Films by studio by country‎
Films by topic by country‎
Films by country and year‎
3D films by country‎
Black-and-white films by country‎
Direct-to-video films by country‎
English-language films by country‎
Feminist films by country‎
Independent films by country‎
Lost films by country‎
Multilingual films by country‎
Rediscovered films by country‎
Short films by country‎
Silent films by country‎
Television films by country‎
Films based on actual events by country‎
Lists of films by country of production
Film series by country
Crossover films by country
 ― Qwerfjkltalk 16:51, 5 May 2022 (UTC)[reply]
@Bearcat: If this just involves replacing /\[\[[Cc]ategory:(...) films\]\]\n?/gi (with nothing) then I could do it. ― Qwerfjkltalk 22:32, 6 May 2022 (UTC)[reply]
I don't really understand what that code syntax means, could you summarize it for the technologically inept? Bearcat (talk) 14:54, 7 May 2022 (UTC)[reply]
@Bearcat, remove[[Category:[country] films]] from the relevant pages. ― Qwerfjkltalk 18:50, 7 May 2022 (UTC)[reply]
Ahhhh, okay. If that would work, then go for it. Bearcat (talk) 18:59, 7 May 2022 (UTC)[reply]
@Bearcat, BRFA filed. ― Qwerfjkltalk 09:28, 14 May 2022 (UTC)[reply]

Removing citation needed tags with references[edit]

There seems to be no automated process to remove {{citation needed}} tags which are occasionally left on an article after a reference is added to the same statement; a recent example of this instance is [1]. I don't know how to gauge the frequency of this problem, as the search tool parses the regex incorrectly, but it is obvious that the citation needed tag should be removed after a reference is added. A draft regex for the operation is given below; I'm not sure yet how to handle {{citation needed span}} wrappers containing references.

Regex Replacement text
</ref>\{\{([Cc]itation needed|[Cc]n)( *\|.*?)?\}\} </ref>
\{\{([Cc]itation needed|[Cc]n)( *\|.*?)?\}\}<ref(.*?)> <ref$3>
\{\{([Cc]itation needed|[Cc]n) span\|([^<\|]+)(\|.*?)?\}\}<ref(.*?)> $2<ref$4>

LaundryPizza03 (d) 20:58, 7 May 2022 (UTC)[reply]

EDIT: Added case matching –LaundryPizza03 (d) 21:07, 7 May 2022 (UTC)[reply]
@LaundryPizza03,
1. Over 2500
2. Over 10,000
3. Over 90
(These are all minimums and may be significantly lower than the actual number, due to the RegEx timing out.) Qwerfjkltalk 21:19, 7 May 2022 (UTC)[reply]
For the citation needed span wrapping the ref, \{\{([Cc]itation needed|[Cc]n) span ?\|([^\}]+\<ref[^\}]+)\}\}$1? ― Qwerfjkltalk 21:41, 7 May 2022 (UTC)[reply]
You would actually have to use $2 in this case, since $1 matches the first set of parentheses, namely the template name. This is acceptable if the final statement is referenced, although I'm not sure how to handle cases where a cn span tag has a in the middle and ends with unreferenced text. Do you think this regex would work acceptably as well? –LaundryPizza03 (d) 21:45, 7 May 2022 (UTC)[reply]
(edit conflict) I just noticed that when I was testing this (the ref tag matches should also extend until the end of the ref, so as to ignore cite templates).  ― Qwerfjkltalk 21:52, 7 May 2022 (UTC)[reply]
Also, this should try to avoid CONTEXTBOT issues ― Qwerfjkltalk 21:54, 7 May 2022 (UTC)[reply]
I can live with that. So no further cases are needed? –LaundryPizza03 (d) 22:02, 7 May 2022 (UTC)[reply]
It's probably better to handle more complex cases manually (the regex I wrote had 6 matches). I doubt any other cases will be very common. I might file a BRFA for this, but currently I'm busy with the above task (maybe), Qwerfjkl (bot) 10, and Qwerfjkl (bot) 8. Still, given the time BRFAs take I'll probably be done with those before it finishes (or at least BRFA 10). ― Qwerfjkltalk 22:09, 7 May 2022 (UTC)[reply]
Careful with \{\{Template.*?\}\} type regexes. I've found that they over-match and have subtle false positives. I prefer the following pattern: \{\{Template[^\}]*\}\}. Ditto for ref tags. –Novem Linguae (talk) 22:58, 7 May 2022 (UTC)[reply]
Novem Linguae, you may find /\{\{(([^\{\}]|\{[^\{]|\}[^\}]|\{\{(([^\{\}]|\{[^\{|\}[^\}])*)\}\})*)\}\}/ somewhat safer as it also catches {{tq|LOOK! } A SINGLE CURLY BRACKET!}} and {{x|{{xy}}}} correctly. Alexis Jazz (talk or ping me) 17:01, 8 May 2022 (UTC)[reply]
This sounds like it would not pass WP:CONTEXTBOT. It is not at all clear why having a {{citation needed}} tag and a <ref> tag always implies that citation is not still needed for some or all content or that the reference added actually supports the material in question. A silly counterexample: Sky is blue.{{citation needed}}<ref>Note: On Earth only.</ref> You would likely need to show a low false positive rate for this task first. —  HELLKNOWZ  TALK 10:16, 8 May 2022 (UTC)[reply]
If a cn tag is followed by a source, CN is never the right template to have. Either [better source needed] or [failed verification]. I'd rather that these were maintenance tagged and followed up by a human. Best Wishes, Lee Vilenski (talkcontribs) 11:12, 8 May 2022 (UTC)[reply]
This seems much better suited for an AWB task than a bot. Headbomb {t · c · p · b} 23:46, 19 May 2022 (UTC)[reply]
I might try this, if I get around to it. ― Qwerfjkltalk 06:12, 20 May 2022 (UTC)[reply]

Bot to preserve categories about to be deleted[edit]

See WP:VPPR#Preserve at Wikidata?. As I said there, there doesn't have to be any bureaucracy for this one - just jump in and start coding. It's a nice self-contained task for beginner bot operators or anyone who wants to get into bots, as well. Enterprisey (talk!) 07:47, 30 January 2022 (UTC)[reply]

Hi @Enterprisey! This caught my eye. To clarify, this is for a bot that generates a list in userspace/on Toolforge of the categories, not directly editing Wikidata, correct? 🐶 EpicPupper (he/him | talk) 05:13, 3 February 2022 (UTC)[reply]
@EpicPupper, right. I suppose we'd have to ask the Wikidata people for permission for a bot there. Enterprisey (talk!) 06:38, 3 February 2022 (UTC)[reply]
@Enterprisey, I might try this (unarchiving thread). ― Qwerfjkltalk 20:20, 8 May 2022 (UTC)[reply]
@Enterprisey, @BD2412, @Sdkb, I haven't completely finished this, but I've given it a start at User:Qwerfjkl/preservedCategories. Is there any clerking of the subpages the bot should do? ― Qwerfjkltalk 18:25, 10 May 2022 (UTC)[reply]
Some thoughts. If a category is empty, it likely does not need to be preserved in any sense. If it is populated, I think it would be useful to have a note of how many pages were in the category. BD2412 T 18:45, 10 May 2022 (UTC)[reply]
@BD2412, where do you think I should note the number of pages in the category - the main page, or its subpages? The latter is fairly easy, but the former would require the bot to maintain the list of subpages, instead of a magic word. I could probably do both. The categories are currently drawn from Category:All categories for discussion - are there any other categories I should check? ― Qwerfjkltalk 19:14, 10 May 2022 (UTC)[reply]
I would put the number on the main page. It will give an immediate sense of which categories only had one or two links in them at the time of deletion. BD2412 T 19:23, 10 May 2022 (UTC)[reply]
It just broke on Category:CS1: long volume value, so probably should limit the pages. ― Qwerfjkltalk 19:34, 10 May 2022 (UTC)[reply]

I would oppose doing this; it is pointless and redundant at best and negates any consensus established at the CfD discussion at worst. Wikipedia:Soft deletion (failed proposal) for articles failed, so its backdoor equivalent for categories should fail as well. * Pppery * it has begun... 19:38, 10 May 2022 (UTC)[reply]

I'll reiterate my view that the best way to preserve the information is to import it to Wikidata, not to create a bunch of subcategories here. In addition to Pppery's concerns, any editor who might benefit from it in the future is far likelier to come across it there than in a userspace subpage jungle. {{u|Sdkb}}talk 19:44, 10 May 2022 (UTC)[reply]
@Sdkb, the point of creating pages here is so the contents of the category is preserved, and that users can export it to Wikidata, even after the category is deleted, when the information might otherwise have been lost. ― Qwerfjkltalk 19:48, 10 May 2022 (UTC)[reply]
I would add that there are certain categories of information that are not readily available from Wikidata, or which would not be parsed at Wikidata, which may still be suitable for listing or discussion in a Wikipedia article. To the extent that editors have hand-curated collections of this information, it should be maintained somewhere in case this utility can be exploited. As it stands, if an article is deleted, there is an article history that can be reviewed. If a category is depopulated, that information is dead. BD2412 T 03:57, 11 May 2022 (UTC)[reply]
I should probably restrict it to mainspace - userspace categories probably aren't worth preserving. In addition, I could only preserve categories with a minimum of X pages/subcategories/total. I could also delete (tag for G7) any preserved categories that still exist after the discussion closes. What do you think, @BD2412, @Sdkb? ― Qwerfjkltalk 15:25, 12 May 2022 (UTC)[reply]
Yes, no userspace categories, and I would think that categories that only ever had one or two pages would also not need to be preserved. BD2412 T 16:23, 12 May 2022 (UTC)[reply]
If anyone's interested, the code's currently at https://public.paws.wmcloud.org/User:Qwerfjkl_(bot)/PreserveCategories.ipynb ― Qwerfjkltalk 17:09, 12 May 2022 (UTC)[reply]

Bot request to popular year lists by country[edit]

Category:Year lists by country has some entries without many things listed on them. Some of those have categories that show a lot of things that could be moved to those list though. Check the year in the category, post the article linked there to the proper list article. If only one link per year exist, then list them by decade instead. For instance I noticed Category:2015 in Brunei had things that weren't in the article 2015 in Brunei so added them. There could be red links in the main article of List of years in Brunei which have things listed in a category that has the name of that year and the name of the country. Dream Focus 16:31, 10 May 2022 (UTC)[reply]

Might have some WP:CONTEXTBOT issues, if I'm understanding this right :) 🐶 EpicPupper (he/him | talk) 08:05, 11 May 2022 (UTC)[reply]

Automatic archival of Twinkle-generated logs[edit]

I had the idea of automatically archiving Twinkle-generated logs for deletion nominations (XfD, PROD, CSD), which can become very long for users who frequently initiate deletion processes, so that only the more recent months appear in the main log. My XfD log was over 160 KB until I set up my own archival system using ClueBot III (talk · contribs), and we can use that as a template. –LaundryPizza03 (d) 19:55, 19 May 2022 (UTC)[reply]

@LaundryPizza03, This should be decided by the users themselves. If you want, you can suggest they do this on their talk page? ― Qwerfjkltalk 20:10, 19 May 2022 (UTC)[reply]
Agreed with Q; we already have multiple archiving bots, and users are welcome to choose which, if any, they wish to use. Primefac (talk) 07:17, 23 May 2022 (UTC)[reply]

Removing user warnings tested at WP:SANDBOX[edit]

User warnings are not allowed on the user sandbox because new users could be afraid they did something wrong or got banned. These could be removed by a bot. It could detect for the text of a substituted template: for example, if it saw the following or similar:

Information icon Hello, I'm Interstatefive. I wanted to let you know that one or more of your recent contributions have been undone because they did not appear constructive. If you would like to experiment, please use your sandbox. If you have any questions, you can ask for assistance at the Teahouse. Thanks.

it would revert. After the bot reverts 3 warnings by the same user in 10 minutes it could send a message to the user stating to go to WP:UWSB to test user warnings. interstatefive  (talk) - just another roadgeek 17:34, 20 May 2022 (UTC)[reply]

I successfully implemented this feature as a bot, but I decided to make a minor change. Instead of leaving a message on the talk page of any user who posts 3 warnings to the sandbox in 10 minutes, I made it so that a warning is posted to the user's talk page if they add a warning to the sandbox at all. This reduces confusion on the side of the editor adding the warnings, and is easier to program. You can see my tests in the edit logs of User:CapsuleBot/sandbox and User talk:Capsulecap. As the bot is not implemented yet I will have to add it to Toolforge in addition to approving its task. Capsulecap (talkcontribs) 18:40, 21 May 2022 (UTC)[reply]

Substitute inappropriate uses of PH wikidata in article text.[edit]

The 2013 wikidata RFC closed with an extremely strong consensus that it is not appropriate to use wikidata in article text on the English wikipedia. A few editors (notably @Exec8: and @HueMan1:), who were presumably unaware of this, have been performing edits where they have been replacing random words in the first paragraph of various Philippine city articles with wikidata templates, typical diffs [2] [3]. Such edits are contrary to the outcome of the RFC and make what should be plain text unnecessarily difficult to edit. I am therefore requesting a one time bot run which will substitute any inappropriate uses of the {{PH wikidata}} template, i.e. those found in article text, rather than infoboxes. 192.76.8.78 (talk) 10:15, 25 May 2022 (UTC)[reply]

This task can be done with AWB, not? NguoiDungKhongDinhDanh 14:57, 25 May 2022 (UTC)[reply]
There are ~1800 pages transcluding {{PH wikidata}}, which is in the realm of bot numbers, but I would somewhat agree that this is probably context-dependent enough to merit at least a cursory pass-through with AWB to see how many pages actually need editing (as I suspect the majority of the transclusions will be only found in the infoboxes). Primefac (talk) 15:04, 25 May 2022 (UTC)[reply]
It appears that some {{PH wikidata}} templates should be removed, while others should be replaced (maybe substituted?) GoingBatty (talk) 16:16, 25 May 2022 (UTC)[reply]
If someone feels this would be better suited to WP:AWBREQ I have no objection to someone moving it.
@GoingBatty The usages of {{PH wikidata}} in infoboxes are OK from a policy standpoint and should be kept, the usages in the body of articles should be substituted so that the article maintains the same text but in non-wikidata template form. 192.76.8.78 (talk) 16:43, 25 May 2022 (UTC)[reply]
In this edit, it seemed more appropriate to delete the template than to substitute it. GoingBatty (talk) 16:57, 25 May 2022 (UTC)[reply]
@GoingBatty Agreed that deletion was proper there, though in the version of the article prior to that edit the template didn't produce any output, so substitution and deletion would have been functionally the same thing (we would have just ended up with duplicate spaces, which are stripped by the parser). How that template ended up there is a mystery, I assume someone must have copied and pasted some text from one of the wikidataified articles. 192.76.8.78 (talk) 17:22, 25 May 2022 (UTC)[reply]
I did a quick test with WP:AWB. Using Wiki search (text) -> hastemplate:"PH wikidata" [4] as the search, and find/replace {{PH wikidata|name}} -> {{subst:PH wikidata|name}} (and of course the other common parameters) works just fine if we want to indiscriminately replace all of these. If we want to skip infoboxes, this task becomes harder and may require a bot. –Novem Linguae (talk) 19:53, 25 May 2022 (UTC)[reply]