Wikipedia:Bots/Requests for approval/BattyBot 9
- 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: GoingBatty (talk · contribs · SUL · edit count · logs · page moves · block log · rights log · ANI search)
Time filed: 23:04, Friday March 16, 2012 (UTC)
Automatic, Supervised, or Manual: Automatic
Programming language(s): AWB
Source code available: AWB
Function overview: Remove article categories from user pages
Links to relevant discussions (where appropriate): WP:USERNOCAT, Wikipedia:Bot requests/Archive 46#Remove article categories from User pages
Edit period(s): Multiple runs
Estimated number of pages affected:
Exclusion compliant (Y/N): Y
Already has a bot flag (Y/N): Y
Function details: On user pages, change any article categories from [[Category:Foo]] to [[:Category:Foo]] (e.g. this link)
Discussion
editHow will you determine if a category should not be removed? Josh Parris 06:36, 17 March 2012 (UTC)[reply]
- When making my list, I will search for user pages that contain article categories, such as those on Wikipedia:Database reports/Polluted categories that are not created by templates. GoingBatty (talk) 14:48, 17 March 2012 (UTC)[reply]
- How will you determine if a category should not be removed? Josh Parris 00:30, 18 March 2012 (UTC)[reply]
On the Bot requests page I had a go at doing this; it is really quite simple and there is a link there to all the edits I did with my main account using AWB. I'm going to request another one in a minute for duplicated functionality. Rcsprinter (warn) 18:21, 17 March 2012 (UTC)[reply]
- If a user page is in one article category, the bot will update all article categories on the page. The bot will not be run against administration categories such as Category:Wikipedians. GoingBatty (talk) 00:37, 18 March 2012 (UTC)[reply]
- Okay, but how do you tell the difference between an article category and some other category? Josh Parris 00:39, 18 March 2012 (UTC)[reply]
- The bot won't know the difference. In order to find user pages to fix, I will use AWB to search for all user pages in some subcategory of Category:Articles, such as Category:Films or Category:Companies established in 2011. GoingBatty (talk) 01:13, 18 March 2012 (UTC)[reply]
- And then delink all categories on that page? Yeah, all isn't that great. Is there some way you can be smarter about it? You seem to have a concept of "article categories", is there some way of enumerating them, or alternatively enumerating categories that are permitted on a user page? Either that, or I'm going to suggest this becomes a supervised/manual task where you clean up any inappropriately delinked cats afterwards. Josh Parris 02:33, 18 March 2012 (UTC)[reply]
- How about excluding categories that start with "Wikipedia" by using F&R rule: "\[\[Category:(.*)\]\](?<!Wikipedia.*)" → "[[:Category:$1]]"? This would change [[Category:Living people]] to [[:Category:Living people]] but not change [[Category:Wikipedians in Oshkosh]]. GoingBatty (talk) 03:31, 18 March 2012 (UTC)[reply]
- You might want to make that case insensitive.
- I'm not convinced the entire problem will be solved via this method (I'm thinking templates need targeting too), but it's a start. I suspect that you're going to have a high false-positive rate. Let's do 50 automatically in Category:Living people, you tell me how many cats got disabled incorrectly:
- I will make it case insensitive - thanks for the suggestions. Templates do need targeting too, but that's outside the scope of this bot request. For example, the bot won't remove Category:Ship infoboxes without an image from user pages, since the bot won't change {{infobox ship begin}}. GoingBatty (talk) 00:13, 19 March 2012 (UTC)[reply]
- For infoboxes, what really needs to happen is some template logic to only add the cat if the template is in mainspace. Josh Parris 01:40, 19 March 2012 (UTC)[reply]
- And for Category:Ship infoboxes without an image, it's not a bad thing that user space pages are in that cat - it is a hidden category, and it allows other editors to find articles as they're being worked on prior to moving them into article space. Josh Parris 02:02, 19 March 2012 (UTC)[reply]
- I will make it case insensitive - thanks for the suggestions. Templates do need targeting too, but that's outside the scope of this bot request. For example, the bot won't remove Category:Ship infoboxes without an image from user pages, since the bot won't change {{infobox ship begin}}. GoingBatty (talk) 00:13, 19 March 2012 (UTC)[reply]
- How about excluding categories that start with "Wikipedia" by using F&R rule: "\[\[Category:(.*)\]\](?<!Wikipedia.*)" → "[[:Category:$1]]"? This would change [[Category:Living people]] to [[:Category:Living people]] but not change [[Category:Wikipedians in Oshkosh]]. GoingBatty (talk) 03:31, 18 March 2012 (UTC)[reply]
- And then delink all categories on that page? Yeah, all isn't that great. Is there some way you can be smarter about it? You seem to have a concept of "article categories", is there some way of enumerating them, or alternatively enumerating categories that are permitted on a user page? Either that, or I'm going to suggest this becomes a supervised/manual task where you clean up any inappropriately delinked cats afterwards. Josh Parris 02:33, 18 March 2012 (UTC)[reply]
- The bot won't know the difference. In order to find user pages to fix, I will use AWB to search for all user pages in some subcategory of Category:Articles, such as Category:Films or Category:Companies established in 2011. GoingBatty (talk) 01:13, 18 March 2012 (UTC)[reply]
- Okay, but how do you tell the difference between an article category and some other category? Josh Parris 00:39, 18 March 2012 (UTC)[reply]
- If a user page is in one article category, the bot will update all article categories on the page. The bot will not be run against administration categories such as Category:Wikipedians. GoingBatty (talk) 00:37, 18 March 2012 (UTC)[reply]
Trial
edit Approved for trial (50 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. to note the prevalence of false-positives. Remember to review afterwards and clean-up after any messes made. Josh Parris 23:53, 18 March 2012 (UTC)[reply]
Trial complete. Here are the 50 edits the bot made. It appears that only article catgeories were changed, so there was no mess to clean up.
- In this edit, only one of the nine article categories was changed. Adding a question mark to the find rule to make the regex non-greedy will fix the issue:
- \[\[Category:(.*?)\]\](?<!Wikipedia.*) → [[:Category:$1]]
- GoingBatty (talk) 02:21, 19 March 2012 (UTC)[reply]
- Looks good. I fixed the one in that link you just gave, but all the rest are fine. Don't think there is much of a false positive risk. Rcsprinter (converse) 14:54, 19 March 2012 (UTC)[reply]
- Thanks Rcsprinter - I saw so concerned not to make a 51st edit with the bot that I ignored the obvious option of fixing it manually with my regular account. GoingBatty (talk) 01:40, 20 March 2012 (UTC)[reply]
- Looks good. I fixed the one in that link you just gave, but all the rest are fine. Don't think there is much of a false positive risk. Rcsprinter (converse) 14:54, 19 March 2012 (UTC)[reply]
Approved. MBisanz talk 03:13, 20 March 2012 (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.