Wikipedia:Bots/Requests for approval/GreenC bot 13
- 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: GreenC (talk · contribs · SUL · edit count · logs · page moves · block log · rights log · ANI search)
Time filed: 00:24, Wednesday, April 3, 2019 (UTC)
Automatic, Supervised, or Manual: automatic
Programming language(s): GNU Awk and BotWikiAwk framework
Source code available: Yes
Function overview: Convert instances of [[Batting average]]
to either [[Batting average (cricket)]]
or [[Batting average (baseball)]]
as appropriate to the topic of the article where the wikilink occurs.
Links to relevant discussions (where appropriate): Wikipedia:Bot_requests#Deal_with_links_to_split_article_(Batting_average)
Edit period(s): one time
Estimated number of pages affected: ~ 15,000
Exclusion compliant (Yes/No): Yes
Already has a bot flag (Yes/No): Yes
Function details: Find all articles containing [[Batting average]]
(or with a pipe) and check page categories to determine if it should link to [[Batting average (cricket)]]
or [[Batting average (baseball)]]
. If the strings "baseball" and "cricket" both appear in an article skip and log. In terms of generating the target article list, for cricket check for: Category:Cricketers, Category:Seasons in cricket and Category:Years in cricket (about 3k links). For baseball: Category:Baseball players, Category:Seasons in baseball, Category:Years in baseball (about 12k links).
Discussion
edit- @Spike 'em: -- GreenC 00:33, 3 April 2019 (UTC)[reply]
- @GreenC: you wrote that the bot does not have a bot flag, but it appears to have a bot flag (granted in 2016) - can you clarify? Thanks, --DannyS712 (talk) 00:32, 3 April 2019 (UTC)[reply]
- Typo, fixed. -- GreenC 00:33, 3 April 2019 (UTC)[reply]
- @GreenC: also, what do you mean by
If categories in both skip and log
- is this supposed to beif in both categories
? --DannyS712 (talk) 00:36, 3 April 2019 (UTC)[reply]- Actually I adjusted per BOTREQ discussion, string anywhere in the article not just category. -- GreenC 01:15, 3 April 2019 (UTC)[reply]
- I thought I'd do some preliminary checks on this proposed solution. I ran through the first 10% of the 12k baseball players which link to Batting average in AWB, searching for "cricket". I found 2 categories Category:Battle Creek Crickets players and Category:Binghamton Cricket players which are for baseball teams with "cricket" in their title. I'll do these via AWB now so they hopefully don't get caught up in the Bot run. I did find 1 proper mention of cricket (a baseball player from Bahamas who also played cricket in his youth), which I've manually processed. I'll try the same but for cricket players. Spike 'em (talk) 10:30, 9 April 2019 (UTC)[reply]
- The first 1k cricketers threw up 6 or so articles which contain "baseball", some just in hat-notes, so between the groups there is less than 1% that may need manual checks. Spike 'em (talk) 10:56, 9 April 2019 (UTC)[reply]
- The bot will catch/log/skip these if it sees the word "baseball" and "cricket" anywhere in the wiki source (article, top hats, categories etc..) -- GreenC 14:06, 9 April 2019 (UTC)[reply]
- Actually I adjusted per BOTREQ discussion, string anywhere in the article not just category. -- GreenC 01:15, 3 April 2019 (UTC)[reply]
- @GreenC: also, what do you mean by
- Not sure if you've dealt with this already, but I think it should be replacing
[[batting average]]
with[[Batting average (cricket)|batting average]]
or[[Batting average (baseball)|batting average]]
Mmitchell10 (talk) 09:42, 6 April 2019 (UTC)[reply]
- This is the purpose of the bot. -- GreenC 18:58, 7 April 2019 (UTC)[reply]
- At the moment it says it will replace
[[batting average]]
with[[Batting average (cricket)]]
, whereas it should be replacing it with[[Batting average (cricket)|batting average]]
. I'm just flagging that we need to make sure we don't change the text that appears. But maybe that's obvious/implicit and I'm being too picky! Mmitchell10 (talk) 19:33, 8 April 2019 (UTC)[reply]- Yeah sorry thought it was evident, it will be obvious what it does if it had permission to do a trial run :) -- GreenC 20:31, 8 April 2019 (UTC)[reply]
- At the moment it says it will replace
- This is the purpose of the bot. -- GreenC 18:58, 7 April 2019 (UTC)[reply]
- Also, we don't want to upset the capitalisation, so need to replace Batting with Batting, and batting with batting. Mmitchell10 (talk) 09:42, 6 April 2019 (UTC)[reply]
- That is what is does. -- GreenC 18:57, 7 April 2019 (UTC)[reply]
Approved for trial (50 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. This is WP:CONTEXTBOT, but a well-constrained one. Let's trial. Headbomb {t · c · p · b} 05:08, 9 April 2019 (UTC)[reply]
- That is what is does. -- GreenC 18:57, 7 April 2019 (UTC)[reply]
- A few more piped terms to add to the search and replace :
[[Batting average#Major League Baseball|
and[[Batting average#Baseball|
to[[Batting average (baseball)|
and[[Batting average#Cricket|
to[[Batting average (cricket)|
Spike 'em (talk) 16:21, 9 April 2019 (UTC)[reply]
- Ah just saw this, posted the same question on your talk page :) Ok can convert these then. -- GreenC 16:40, 9 April 2019 (UTC)[reply]
Trial complete. - Diffs. -- GreenC 17:03, 9 April 2019 (UTC)[reply]
- The edit summaries for the first 45 were a little off, fixed in the final 5 edits. Otherwise see no problem, but appreciate anyone taking a look. -- GreenC 17:03, 9 April 2019 (UTC)[reply]
- Looks good to me. What happens if you run across things like Category:Battle Creek Crickets players? Headbomb {t · c · p · b} 17:10, 9 April 2019 (UTC)[reply]
- The bot will detect the article contains both strings "baseball" and "cricket" then log and skip. Spike'em estimates there might be 1% like this which is doable for manual context edits. -- GreenC 17:28, 9 April 2019 (UTC)[reply]
Approved for extended trial (Category:Battle Creek Crickets players and Category:Binghamton Cricket players). Please provide a link to the relevant contributions and/or diffs when the trial is complete. Then let's try to break the bot and see if it makes any edits there. Headbomb {t · c · p · b} 17:44, 9 April 2019 (UTC)[reply]
- The bot will detect the article contains both strings "baseball" and "cricket" then log and skip. Spike'em estimates there might be 1% like this which is doable for manual context edits. -- GreenC 17:28, 9 April 2019 (UTC)[reply]
- Looks good to me. What happens if you run across things like Category:Battle Creek Crickets players? Headbomb {t · c · p · b} 17:10, 9 April 2019 (UTC)[reply]
- The edit summaries for the first 45 were a little off, fixed in the final 5 edits. Otherwise see no problem, but appreciate anyone taking a look. -- GreenC 17:03, 9 April 2019 (UTC)[reply]
Done, no edits made.
bot log
|
---|
|
-- GreenC 18:07, 9 April 2019 (UTC)[reply]
- I checked through a reasonable set of them and they look good to me too. Spike 'em (talk) 10:40, 10 April 2019 (UTC)[reply]
Trial complete. -- GreenC 19:30, 9 April 2019 (UTC)[reply]
Approved. Looks like everything's been considered. Primefac (talk) 21:14, 27 April 2019 (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.