I'm not sure if this is the right place to ask, but I've just written a bot,
and Wikipedia policy says it should be approved before I set it loose.
I recently moved [[Brisbane, Queensland]] to [[Brisbane]], and then started
fixing the links to those pages. I got through about 100 pages and I wasn't
even a third of the way there, and I though "it would be easier to just
write a bot". So I did.
The bot takes a list of article titles, and runs a Perl search and replace
operation on the HTML escaped wikitext. The idea is to manually extract the
list of titles from Special:Whatlinkshere, and then replace all links to the
old page with links to the new page.
It will be running from username "Timbot". I've tested it on
test.wikipedia.org. It runs in "trickle" mode, i.e. like this:
while (<ARTICLES>) {
chomp($_);
DoPage($_);
if (time - $lastTime < $delay) {
sleep($delay - $lastTime + $time);
}
$lastTime = time;
}
I'm open to suggestions as to the setting of $delay. If anyone wants to see
the rest of the code, I'll send it by private email.
-- Tim Starling.
_________________________________________________________________
MSN Instant Messenger now available on Australian mobile phones. Go to
http://ninemsn.com.au/mobilecentral/hotmail_messenger.asp
and Wikipedia policy says it should be approved before I set it loose.
I recently moved [[Brisbane, Queensland]] to [[Brisbane]], and then started
fixing the links to those pages. I got through about 100 pages and I wasn't
even a third of the way there, and I though "it would be easier to just
write a bot". So I did.
The bot takes a list of article titles, and runs a Perl search and replace
operation on the HTML escaped wikitext. The idea is to manually extract the
list of titles from Special:Whatlinkshere, and then replace all links to the
old page with links to the new page.
It will be running from username "Timbot". I've tested it on
test.wikipedia.org. It runs in "trickle" mode, i.e. like this:
while (<ARTICLES>) {
chomp($_);
DoPage($_);
if (time - $lastTime < $delay) {
sleep($delay - $lastTime + $time);
}
$lastTime = time;
}
I'm open to suggestions as to the setting of $delay. If anyone wants to see
the rest of the code, I'll send it by private email.
-- Tim Starling.
_________________________________________________________________
MSN Instant Messenger now available on Australian mobile phones. Go to
http://ninemsn.com.au/mobilecentral/hotmail_messenger.asp