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]

Typo, fixed. -- GreenC 00:33, 3 April 2019 (UTC)Reply[reply]
@GreenC: also, what do you mean by If categories in both skip and log - is this supposed to be if in both categories? --DannyS712 (talk) 00:36, 3 April 2019 (UTC)Reply[reply]
Actually I adjusted per BOTREQ discussion, string anywhere in the article not just category. -- GreenC 01:15, 3 April 2019 (UTC)Reply[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[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[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[reply]
This is the purpose of the bot. -- GreenC 18:58, 7 April 2019 (UTC)Reply[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[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[reply]
That is what is does. -- GreenC 18:57, 7 April 2019 (UTC)Reply[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[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[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[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[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[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[reply]

Done, no edits made.

bot log
  • Clint Rogge ---- error Contains baseball and cricket
  • Clint Rogge ---- error : batting average wikilink not found
  • Pat Duncan (baseball) ---- error Contains baseball and cricket
  • Pete Fahrer ---- error Contains baseball and cricket
  • Pat Duncan (baseball) ---- error : batting average wikilink not found
  • Pete Fahrer ---- error : batting average wikilink not found
  • Oscar Graham ---- error Contains baseball and cricket
  • Oscar Graham ---- error : batting average wikilink not found
  • Harry LaRoss ---- error Contains baseball and cricket
  • Dutch Zwilling ---- error Contains baseball and cricket
  • Ray Brubaker ---- error Contains baseball and cricket
  • Charlie Krause ---- error Contains baseball and cricket
  • Larry Gilbert (baseball) ---- error Contains baseball and cricket
  • Ray Brubaker ---- error : batting average wikilink not found
  • Charlie Krause ---- error : batting average wikilink not found
  • Wese Callahan ---- error Contains baseball and cricket
  • Wese Callahan ---- error : batting average wikilink not found
  • Baby Doll Jacobson ---- error Contains baseball and cricket
  • Harry LaRoss ---- error : batting average wikilink not found
  • Dutch Zwilling ---- error : batting average wikilink not found
  • Garland Nevitt ---- error Contains baseball and cricket
  • Garland Nevitt ---- error : batting average wikilink not found
  • Baby Doll Jacobson ---- error : batting average wikilink not found
  • Grover Hartley ---- error Contains baseball and cricket
  • Bill Culp ---- error Contains baseball and cricket
  • Bill Culp ---- error : batting average wikilink not found
  • Katsy Keifer ---- error Contains baseball and cricket
  • Pete Compton ---- error Contains baseball and cricket
  • Katsy Keifer ---- error : batting average wikilink not found
  • Pete Compton ---- error : batting average wikilink not found
  • Larry Gilbert (baseball) ---- error : batting average wikilink not found
  • Grover Hartley ---- error : batting average wikilink not found
  • Hardy Richardson ---- error Contains baseball and cricket
  • Hardy Richardson ---- error : batting average wikilink not found
  • Art Allison ---- error Contains baseball and cricket
  • Art Allison ---- error : batting average wikilink not found
  • John Morrissey (baseball) ---- error Contains baseball and cricket
  • John Morrissey (baseball) ---- error : batting average wikilink not found
  • Buttercup Dickerson ---- error Contains baseball and cricket
  • Buttercup Dickerson ---- error : batting average wikilink not found
  • Bobby Clack ---- error Contains baseball and cricket
  • Bobby Clack ---- error : batting average wikilink not found
  • Bill Smiley ---- error Contains baseball and cricket
  • Bill Smiley ---- error : batting average wikilink not found
  • Blondie Purcell ---- error Contains baseball and cricket
  • John Richmond (shortstop) ---- error Contains baseball and cricket
  • Blondie Purcell ---- error : batting average wikilink not found
  • John Montgomery Ward ---- error Contains baseball and cricket
  • Frank Heifer ---- error Contains baseball and cricket
  • John Montgomery Ward ---- error : batting average wikilink not found
  • Frank Heifer ---- error : batting average wikilink not found
  • Harry Arundel ---- error Contains baseball and cricket
  • John Richmond (shortstop) ---- error : batting average wikilink not found
  • Harry Arundel ---- error : batting average wikilink not found
  • Jim Whitney ---- error Contains baseball and cricket
  • John Shoupe ---- error Contains baseball and cricket
  • Horace Phillips (baseball) ---- error Contains baseball and cricket
  • John Shoupe ---- error : batting average wikilink not found
  • Horace Phillips (baseball) ---- error : batting average wikilink not found
  • Ed Kennedy (outfielder) ---- error Contains baseball and cricket
  • Ed Kennedy (outfielder) ---- error : batting average wikilink not found
  • Jim Whitney ---- error : batting average wikilink not found
  • John McGuinness (baseball) ---- error Contains baseball and cricket
  • John McGuinness (baseball) ---- error : batting average wikilink not found
  • Hal McClure ---- error Contains baseball and cricket
  • Hal McClure ---- error : batting average wikilink not found
  • Pop Smith ---- error Contains baseball and cricket
  • Pop Smith ---- error : batting average wikilink not found

-- GreenC 18:07, 9 April 2019 (UTC)Reply[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[reply]

 Approved. Looks like everything's been considered. Primefac (talk) 21:14, 27 April 2019 (UTC)Reply[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.