Wikipedia:Bots/Requests for approval/Martin's bot
- 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: MSGJ (talk · contribs)
Time filed: 20:50, Tuesday March 29, 2011 (UTC)
Automatic or Manually assisted: automatic, supervised
Programming language(s): AWB
Source code available: Yes, see below
Function overview: Replace the values of a parameter in the {{baseballstats}} template to allow the external links to continue to work after pages were reorganised on website http://www.thebaseballcube.com
Links to relevant discussions (where appropriate): Template talk:Baseballstats#Pages moved on The Baseball Cube, and responding to request at Wikipedia:Bot requests/Archive 41/Archives/ 23#The Baseball Cube.
Edit period(s): one run
Estimated number of pages affected: Template:Baseballstats has 13882 transclusions although not all of them will have the cube parameter specified.
Exclusion compliant (Y/N): per usual AWB practice
Already has a bot flag (Y/N): N
Function details: The bot will replace the value of the cube parameter from the form "First.initial.of.last.name/First.name-Last.name" to the form "First.name-Last.name". To do this it will search for cube=[A-Z]/(.*)-(.*) and replace it with cube=$1-$2. There is no reason to believe that this will be at all controversial.
Discussion
[edit]It would seem simpler to rewrite the template to take both forms of the argument. In pseudocode:
- if &cube matches =[A-Z]/(.*)-(.*), cube1 =$1-$2
- else cube1 = &cube
and then use &cube1 instead of &cube. Septentrionalis PMAnderson 19:15, 30 March 2011 (UTC)[reply]
- I did consider this, but then we will be left with people wondering why it's cube1 and not cube. Also there will be many editors who got used to using cube and will continue doing so. So no, I think it will be better to keep to the same parameter. What I can do though, is stick some temporary code in the template which will determine (using string functions) which form is being used and allow it to work with either in the transition period. — Martin (MSGJ · talk) 21:10, 30 March 2011 (UTC)[reply]
- I'm sorry I was unclear. I suggest using &cube1 only as an internal variable within the template; unless somebody reads the source for template:Baseballstats, it should be invisible. Septentrionalis PMAnderson 21:19, 30 March 2011 (UTC)[reply]
- Ah, I understand now. The reason why your solution would be sub-optimal is that it would rely on using an expensive string manipulation template indefinitely. I think these things are fine as a temporary measure, but we really shouldn't be using them forever because it makes pages slower to load. — Martin (MSGJ · talk) 21:26, 30 March 2011 (UTC)[reply]
- I'm sorry I was unclear. I suggest using &cube1 only as an internal variable within the template; unless somebody reads the source for template:Baseballstats, it should be invisible. Septentrionalis PMAnderson 21:19, 30 March 2011 (UTC)[reply]
Note: I will be away for a couple of weeks, but if this can be approved I can make a start when I return. Cheers — Martin (MSGJ · talk) 09:32, 2 April 2011 (UTC)[reply]
Approved for trial (50 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. MBisanz talk 01:01, 4 April 2011 (UTC)[reply]
- Thanks. Will get started shortly. — Martin (MSGJ · talk) 16:51, 17 April 2011 (UTC)[reply]
Trial complete. (contributions). I don't think there were any errors. — Martin (MSGJ · talk) 18:28, 18 April 2011 (UTC)[reply]
Approved. MBisanz talk 20:09, 18 April 2011 (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.