Wikipedia:Bots/Requests for approval/Redirectbot 2
- 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 Denied.
Operator: Philroc (talk · contribs · SUL · edit count · logs · page moves · block log · rights log · ANI search)
Time filed: 00:42, Friday, October 23, 2015 (UTC)
Automatic, Supervised, or Manual: Automatic
Programming language(s): C#
Source code available: http://www.mediafire.com/view/rtytufd3ymum45e/Redirectbot.cs (no bot password)
Function overview: Redirects to lists, from the things they are lists of
Links to relevant discussions (where appropriate): WP:Bot requests#Redirects to lists, from the things they are lists of
Edit period(s): Continuous
Estimated number of pages affected: ~13000
Exclusion compliant (Yes/No): No
Already has a bot flag (Yes/No): No
Function details: This is a retry of a failed BRFA for this bot. You can see it here. Breakdown of this bot's task: 1. The bot will look through Special:AllPages for articles titled "List of *" 2. When it finds an article, it will check to see if an article which is named what is in the wildcard exists 3a. If it does exist, the bot will do nothing. 3b. If it doesn't exist, the bot will create it with the text "#REDIRECT [[(name of list)]]" 4. Repeat
And you don't need exclusion compliance when you're just making redirects.
Discussion
editJust commenting here to link to a discussion on my talk page and to say that I do not feel my concerns have been adequately addressed. I would like another BAG member to handle this. — Earwig talk 01:34, 23 October 2015 (UTC)[reply]
- @The Earwig: Uhm, but you're the only BAG member that's really active... PhilrocMy contribs 12:30, 24 October 2015 (UTC)[reply]
Have you tried running the code in a testing environment? I can't imagine it actually works:
- Why's the whole thing wrapped inside an endless while loop?
- Lines 19 to 21
- Are you looping over the entire list of pages on Wikipedia? Isn't there a way to pre-filter pages?
- Line 23
- String.StartsWith would also work.
- Line 25
- The substring of a string is a string. Does C# type juggle? I wouldn't expect it to.
- Lines 26 to 28:
- (a) See above; you're comparing strings with ints.
- (b) The or (|) operator has got higher precedence than the comparison operator; therefore, the condition will always be
true
. - (c) ToUpper is a method. Methods take parentheses.
- (d) You don't actually need to check if the first character's a digit; ToUpper will simply leave it untouched.
- (e) Presumably, you cannot actually create pages beginning with lowercase characters on Wikipedia, so this is all pointless.
- Line 29:
- Methods are capitalised in C#; it should be "String.Join".
- Line 33:
- You need to escape the double braces.
- Line 35:
- Why does it sleep for 10 whole seconds?
- The bot will create redirects from titles such as "Athletes from Maryland A – M", which we previously thought was undesirable behaviour. You're gonna have to fine-tune your regexes.
I think you're probably new to programming and C#, so why not look at what people have done before you? ;-) Alakzi (talk) 16:40, 24 October 2015 (UTC)[reply]
- While loop: because it needs to update in case new "list of" articles come up.
- Lines 19 to 21: I can't pre-filter because new "list of" pages can come up beyond the end of the filter.
- Line 23: But I don't have to use it.
- Line 25: It's so it can make a redirect out of the stuff after "List of". And this isn't C, it's C#, the [] in arrays comes after the type, not the name.
- Lines 26 to 28: a: Mistake, fixed it. b: Don't know what that means. c: Mistake, fixed it. d. OOOOHHHH, ok. Fixed that. e. Yeah, which is why I used the .ToUpper method.
- Line 29: Mistake, fixed that.
- Line 33: I know what escaping means, but how to do that in things beside regexes?
- Line 35: Bot policy says that bots doing non-urgent tasks (like creating redirects) run at a slower rate. Mistake in my regex, fixed.
- And I actually hit "Play" on my IDE, and it gave me errors. PhilrocMy contribs 23:29, 24 October 2015 (UTC)[reply]
- Thanks for making the changes! Regarding the while loop - well, it won't actually "update" anything, will it? It'll simply fetch a new list the next time it runs; it's really no better than relaunching the program. As for (b), imagine there's an extra pair of parentheses around "pagetemp" and "1":
if ((pagetemp[0] != 1) | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0) ...
. The way to check if the first character is a digit is - quite simply -Char.IsDigit(pagetemp[0])
. With regard to line 25, my point was that you cannot assign a string to an array variable; you'd first have to split the string by character.I know what escaping means, but how to do that in things beside regexes?
Double up the braces. - I've not got the .NET suite on my machine (no Windows), but I could try it all out in Mono if you're having trouble. Could you reupload the code? Alakzi (talk) 00:33, 25 October 2015 (UTC)[reply]
- "Double up"? WTH are you talking about? And about the while loop, it does fetch a new list each time - each new list might have new "list of" articles. And I reuploaded the source, check the "source code" section again. PhilrocMy contribs 00:45, 25 October 2015 (UTC)[reply]
- Double up. Line 25 still isn't gonna work: title.Substring(8) is a string; pagetemp is an array of strings. With the exception of some number types, C# will not implicitly convert from one type to another. There's several ways to approach this, but if we're to stay faithful to your thing, replace lines 25 and 26 with the following:
- "Double up"? WTH are you talking about? And about the while loop, it does fetch a new list each time - each new list might have new "list of" articles. And I reuploaded the source, check the "source code" section again. PhilrocMy contribs 00:45, 25 October 2015 (UTC)[reply]
- Thanks for making the changes! Regarding the while loop - well, it won't actually "update" anything, will it? It'll simply fetch a new list the next time it runs; it's really no better than relaunching the program. As for (b), imagine there's an extra pair of parentheses around "pagetemp" and "1":
char[] pagetemp = title.Substring(8).ToCharArray();
pagetemp[0] = Char.ToUpper(pagetemp[0]);
- Assuming the code actually runs now, you're gonna have to wait for a BAGer to review your request. Alakzi (talk) 01:17, 25 October 2015 (UTC)[reply]
- But there are two curly braces on the line you talked about, which one do I double up? PhilrocMy contribs 01:25, 25 October 2015 (UTC)[reply]
- Replace "{{R from list topic}}" with "{{{{R from list topic}}}}". Alakzi (talk) 01:28, 25 October 2015 (UTC)[reply]
- Did that, kthxbai. PhilrocMy contribs 01:36, 25 October 2015 (UTC)[reply]
- Replace "{{R from list topic}}" with "{{{{R from list topic}}}}". Alakzi (talk) 01:28, 25 October 2015 (UTC)[reply]
- But there are two curly braces on the line you talked about, which one do I double up? PhilrocMy contribs 01:25, 25 October 2015 (UTC)[reply]
- Assuming the code actually runs now, you're gonna have to wait for a BAGer to review your request. Alakzi (talk) 01:17, 25 October 2015 (UTC)[reply]
Where did the "~13000" estimate come from? I think creating some of these redirects is a neat idea, but it probably requires human (editorial) judgment. Some redirects don't make much sense; doing this programmatically is likely a poor idea due to the edge cases. --MZMcBride (talk) 04:03, 25 October 2015 (UTC)[reply]
- From this list. PhilrocMy contribs 12:03, 25 October 2015 (UTC)[reply]
- And I've fine-tuned my regexes enough so edge cases won't mess it up. PhilrocMy contribs 12:04, 25 October 2015 (UTC)[reply]
- The linked list is obviously truncated. Or are you saying that this bot approval will only be for 0 through 9 and A through Cities? If not, it'd probably be nice to have a more accurate estimate.
- What do you think about redirects such as Allied military operations of the Vietnam War (1964) and American Civil War Medal of Honor recipients: A–F? I'm not sure these types of redirects are really helping readers/searchers. --MZMcBride (talk) 03:40, 26 October 2015 (UTC)[reply]
- I like the first, but not the second. PhilrocMy contribs 11:35, 26 October 2015 (UTC)[reply]
- And I've fine-tuned my regexes enough so edge cases won't mess it up. PhilrocMy contribs 12:04, 25 October 2015 (UTC)[reply]
It is said above that Redirects like "Athletes from Maryland A – M" were "previously thought... undesirable behaviour". I disagree, such a redirect enables a reader - say, one who is returning but mis-remembering the list page title - to find the relevant list using our auto-complete function. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 16:44, 27 October 2015 (UTC)[reply]
- This is really iffy, I think. Creating redirects for people who mis-remembered page titles would justify a lot of improbable redirects we don't generally create*, and they could still find the title by going through Athletes from Maryland, which the bot would create**, or by using search.
- * Like the same title but A–L, A–K, etc.
- ** It wouldn't, actually, since List of athletes from Maryland is a redirect. But that seems like a bad example; in my understanding we don't usually structure split-lists that way.
- — Earwig talk 05:15, 28 October 2015 (UTC)[reply]
- @MZMcBride: Actually, the bot wouldn't even create the redirects you listed because of my regex. PhilrocMy contribs 12:52, 28 October 2015 (UTC)[reply]
1. Has any community discussion of this taken place? This is something that would affect most lists ever made. Some discussion at MOS:LIST would likely be in order. 2. Furthermore, the concerns about WP:CONTEXTBOT are valid. Even as I'm looking on MOS:LIST, there's an incidental reference to one instance where, e.g., List of vegetable oils shouldn't translate to Vegetable oils. Yes, a redirect to Vegetable oil, singular, already exists and could be checked for, but that's not the point: someone looking at Vegetable oils isn't necessarily looking for the list. --slakr\ talk / 03:04, 1 November 2015 (UTC)[reply]
- Denied. — On further investigation, apparently the issues related to the account's security still haven't been rectified. Based on that, alone, there's a basic security issue and editing-experience issue that's self-evident and incompatible with the safe functioning of an automated account on this project. Ignoring that and dealing solely with the concerns raised above, I can't confidently say that this bot has consensus to run within the bounds of the bot policy and therefore the expectations of the community. --slakr\ talk / 01:18, 2 November 2015 (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.