Wikipedia:Bots/Requests for approval/MadmanBot 14
- 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: Madman (talk · contribs · SUL · edit count · logs · page moves · block log · rights log · ANI search)
Time filed: 16:26, Wednesday March 28, 2012 (UTC)
Automatic, Supervised, or Manual: Automatic.
Programming language(s): PHP.
Source code available: Yes.
Function overview: Changes host of (dead) external links to www.zerozerofootball.com to www.footballzz.co.uk. Replaces links to http://www.zerozerofootball.com/jogador.php with {{Zerozero profile}} to accommodate any future changes in domain name.
Links to relevant discussions (where appropriate): Wikipedia talk:WikiProject Football#Bugger :(, Wikipedia:Bot requests/Archive 47#Bot needed to convert links to a template
Edit period(s): One-time run.
Estimated number of pages affected: 1771.
Exclusion compliant (Y/N): Yes.
Already has a bot flag (Y/N): Yes.
Function details: 50 example diffs of first change here, 50 example diffs of second change here.
Discussion
[edit]-*[http://www.zerozerofootball.com/arbitro.php?id=848&search=1 István Zsolt :: zerozerofootball.com]
+*[http://www.footballzz.co.uk/arbitro.php?id=848&search=1 István Zsolt :: zerozerofootball.com]
"Edits" look fine technically. Any chance something like above can be handled? Like a report of pages that may have "zerozerofootball" somewhere for manual review. And replacing obvious ones. — HELLKNOWZ ▎TALK 16:45, 28 March 2012 (UTC)[reply]
- Yes, I can have it replace "zerozerofootball.com" within link text with "footballzz.co.uk". — madman 17:01, 28 March 2012 (UTC)[reply]
- What about outside links, specifically following on the same line in external links: — HELLKNOWZ ▎TALK 17:09, 28 March 2012 (UTC)[reply]
-* [http://www.zerozerofootball.com/equipa.php?id=10751 club profile] at zerozerofootball.com
+* [http://www.footballzz.co.uk/equipa.php?id=10751 club profile] at zerozerofootball.com
- There's also could be stuff like
|publisher=zerozerofootball.com
. — HELLKNOWZ ▎TALK 17:03, 28 March 2012 (UTC)[reply]- (edit conflict) If it's within the link text, it would be changed. If not, I'd be a little hesitant to change it, I think. I'm not saying I couldn't do it and do it correctly, but I'd want to hard-code the names of templates that should be changed and that sort of thing. It's a little context-sensitive, whereas changing explicit links to the site is pretty foolproof. — madman 17:06, 28 March 2012 (UTC)[reply]
- I think
|publisher=
and|work=
are generally safe to change. — HELLKNOWZ ▎TALK 17:09, 28 March 2012 (UTC)[reply]- I'll look into changing those template parameters. As far as replacing any instance of the host name within the content of the article... I don't know. If the requester wanted me to do that and I was approved to do so, I would (I'll direct the requester here). But it just seems to be asking to screw up an edge case I haven't thought of. (I'm a little conservative; can you tell? ) — madman 17:13, 28 March 2012 (UTC)[reply]
- I think
- (edit conflict) If it's within the link text, it would be changed. If not, I'd be a little hesitant to change it, I think. I'm not saying I couldn't do it and do it correctly, but I'd want to hard-code the names of templates that should be changed and that sort of thing. It's a little context-sensitive, whereas changing explicit links to the site is pretty foolproof. — madman 17:06, 28 March 2012 (UTC)[reply]
- There's also could be stuff like
I'll update the code later today to change the domain name within link text, no problem. I'm fine with changing the domain name on the same line as the link as well. Templates might be a little more difficult, as I can't use a regular expression for that and my template parser currently needs the names of the templates to change. The scope of this task is larger than I anticipated. But I suppose it helps me test my framework and gives me code that can be reused later. — madman 17:39, 28 March 2012 (UTC)[reply]
- Hi, I'm the original proposer/nominator. Ideally I'd like all links changed to meet {{Zerozero profile}}, if that's possible. GiantSnowman 17:55, 28 March 2012 (UTC)[reply]
- They will be. See [1] for example edits. Right now we're discussing to what extent links that are to zerozerofootball.com but are not to a profile should changed. Hellknowz, I have modified the code to change the domain name within link text and on the same line at the link; please see the updated diffs.
-*[http://www.zerozerofootball.com/arbitro.php?id=848&search=1 István Zsolt :: zerozerofootball.com<!-- Bot generated title -->
+*[http://www.footballzz.co.uk/arbitro.php?id=848&search=1 István Zsolt :: footballzz.co.uk<!-- Bot generated title -->]
-* [http://www.zerozerofootball.com/equipa.php?id=10751 club profile] at zerozerofootball.com
+* [http://www.footballzz.co.uk/equipa.php?id=10751 club profile] at footballzz.co.uk
- Note that I'm not changing references that aren't to the domain name (e.g. Profile at ZeroZero, zerozerofootball), as I'm not altogether clear on the name of the site; it says football.co.uk in the title (which is wrong), has a top bar that says zerozero, a logo that says footballzz.co.uk, and a login that says Club ZeroZero. — madman 18:32, 28 March 2012 (UTC)[reply]
- I don't think template parameters are going to need to be changed. It looks like when zerozerofootball.com appears in the publisher parameter, it's in an external link, which means it gets changed properly. I need to have the bot also change bare URLs (e.g.
|url=http://www.zerozerofootball.co.uk/...
and that should cover all bases. — madman 18:39, 28 March 2012 (UTC)[reply]- Now bare URLs are changed; in the subset of pages being used for trials, there's at least one change to every page and there are no references at all to the old domain name within the content of the page after changes. — madman 19:47, 28 March 2012 (UTC)[reply]
- I don't think template parameters are going to need to be changed. It looks like when zerozerofootball.com appears in the publisher parameter, it's in an external link, which means it gets changed properly. I need to have the bot also change bare URLs (e.g.
Approved for trial (30 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. — HELLKNOWZ ▎TALK 19:49, 28 March 2012 (UTC)[reply]
- Trial complete. – [2] — madman 20:29, 28 March 2012 (UTC)[reply]
Approved. All good, have fun. — HELLKNOWZ ▎TALK 20:33, 28 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.