User talk:MerlLinkBot/Archives/2011

February 2011
Welcome to Wikipedia. Wikipedia invites everyone to contribute constructively to the encyclopedia, but one or more links you edited, such as with Counter Rocket, Artillery, and Mortar‎, have been considered disruptive and/or malicious, and have been reverted. Take a look at the welcome page if you would like to learn more about contributing to the encyclopedia. Thank you. Srobak (talk) 19:12, 4 February 2011 (UTC)
 * 2nd revert for leading to a 404. Please adjust your bot. Srobak (talk) 16:05, 6 February 2011 (UTC)
 * For me http://www.jpost.com/servlet/Satellite?cid=1196847389509&pagename=JPost%2FJPArticle%2FPrinter redirects to http://www.jpost.com and http://fr.jpost.com/servlet/Satellite?cid=1196847389509&pagename=JPost%2FJPArticle%2FPrinter shows me a page with the title "Israel may buy rapid-fire cannon". So the edit of my bot looks ok for me. Merlissimo 15:38, 10 February 2011 (UTC)

commonwealthgames.co.nz has been moved to olympic.co.nz
Hi there Merlissimo,

I came across a wiki page for a NZ swimmer (http://en.wikipedia.org/wiki/Lyall_Barry), but the 'reference' link was pointing to a dead domain. I figured out that the 'http://www.commonwealthgames.org.nz' domain has since been relocated to 'http://www.olympic.org.nz/'. Their website has also been upgraded, so the original URL format no longer works.

I fixed the reference link for "Lyall Barry", but there are still 361 other wiki pages that have a reference link pointing to 'http://www.commonwealthgames.org.nz/Athletes/AthleteProfile/********'.

Here are the search results for all pages that contain the outdated links: http://en.wikipedia.org/w/index.php?title=Special:Search&ns0=1&redirs=0&search=http%3A%2F%2Fwww.commonwealthgames.org.nz%2FAthletes%2FAthleteProfile&limit=500&offset=0

The URL replacement would be done with a regular expression. The following example is written in ruby:

wiki_title_as_url = wiki_title.downcase.gsub(" ", "-").gsub(/[^a-zA-Z0-9 ]/, '-').gsub(/\([^)]*\)/, "").strip wiki_content.gsub(/((http:\/\/)?www.commonwealthgames.org.nz\/Athletes\/AthleteProfile\/[^ ]*)/, "http://www.olympic.org.nz/nzolympic/athlete/" << wiki_title_as_url)

As an example, consider the page at http://en.wikipedia.org/wiki/Harry_Kent_%28cyclist%29 Your script would replace:

http://www.commonwealthgames.org.nz/Athletes/AthleteProfile.aspx?Print=&ContactID=1120&id=3780

with

http://www.olympic.org.nz/nzolympic/athlete/harry-kent

(where 'harry-kent' is extracted from the title of the wiki page, and any text in paranthesis is removed, e.g. '(cyclist)' .)

Please let me know if you would consider doing this. I could have written my own bot, but you seem to have already done all of the hard work :-)

Thanks, Nathan B

P.S. I've already posted my issue here: http://en.wikipedia.org/wiki/Wikipedia:Village_pump_%28idea_lab%29#Quick_way_to_update_links_after_domain-name_change_.2F_page_relocation — Preceding unsigned comment added by Nathan.f77 (talk • contribs) 08:30, 23 April 2011 (UTC)