Forum:Large job

We've been linking to some pages on the official RuneScape page, though they've updated all the URLs. So every single website has to be changed, and this is a huge job. Is there a bot or something that can fix this?--Richard (Talk - Contribs) 20:48, 24 April 2007 (UTC)


 * What's the change in URL? G .He (Talk!) 21:29, 24 April 2007 (UTC)


 * Using the pywikipediabot framework you could use replace.py to setup a regex replace which could be run through the entire wiki. For example if it was a domain name change from www.example.com to foo.bar.org:

python replace.py -family:runescape -start:! -regex "http://(www\.)?example\.com" "http://foo.bar.org"
 * Would replace links such as http://www.example.com, http://example.com, http://www.example.com/something with http://foo.bar.org, http://foo.bar.org, and http://foo.bar.org/something inside of the (main) namespace. Of course it's also possible to expand the replacements to do something such as only replace it if it's inside of the [] link tags. ~Dantman(talk) tricks Apr 24, 2007 @ 23:02 (UTC)

They changed the URL like this:

 http://kbase.runescape.com/viewarticle.ws?article_id=1234

The new form of URL for knowledge base article "1234" is:  http://www.runescape.com/kbase/viewarticle.ws?article_id=1234

Just a minor change, but all the links have an error message.--Richard (Talk - Contribs) 00:48, 25 April 2007 (UTC)


 * Run this function after you've setup a family file for your wiki (Use one of the ones I made for other Wikia at User:Dantman/Pywikipediabot as a base):

python replace.py -family:runescape -start:! "http://kbase.runescape.com/viewarticle.ws" "http://www.runescape.com/kbase/viewarticle.ws"
 * And that should replace the url's in the Main namespace. You'll half to replace the ! with something like Help: if you want to run it over another namespace after that. It would also be a good idea to get a bot flag for the account you create to do this. ~Dantman(talk) tricks Apr 25, 2007 @ 01:18 (UTC)

My bot won't change the pages. It finds them, and asks if I want to change them, I say yes, but then it says it can't. That's what it says on the right there.--Richard (Talk - Contribs) 16:31, 25 April 2007 (UTC)


 * Show me your families/runescape_family.py, and user-config.py setup. It's also always a good idea to once in awhile ruin the update function of CVS. ~Dantman(talk) tricks Apr 25, 2007 @ 18:08 (UTC)

Here's my user-config.py: mylang = 'en' family = 'runescape' usernames['runescape']['en'] = u'Richardbot' and my family (runescape_family.py): import family
 * 1) -*- coding: utf-8  -*-


 * 1) The RuneScape Wiki (runescape.wikia.com)

class Family(family.Family):

def __init__(self):

family.Family.__init__(self)

self.name         = 'runescape' self.langs        = { 'en':         'runescape.wikia.com', } # Most namespaces are inherited from family.Family. self.namespaces[1] = { '_default': u'Talk', } self.namespaces[2] = { '_default': u'User', } self.namespaces[3] = { '_default': u'User talk', } self.namespaces[4] = { '_default': u'RuneScape', } self.namespaces[5] = { '_default': u'RuneScape talk', } self.namespaces[6] = { '_default': u'Image', } self.namespaces[7] = { '_default': u'Image talk', } self.namespaces[8] = { '_default': u'MediaWiki', } self.namespaces[9] = { '_default': u'MediaWiki talk', } self.namespaces[10] = { '_default': u'Template', } self.namespaces[11] = { '_default': u'Template talk', } self.namespaces[12] = { '_default': u'Help', } self.namespaces[13] = { '_default': u'Help talk', } self.namespaces[14] = { '_default': u'Category', } self.namespaces[15] = { '_default': u'Category talk', } # Custom namespace list for en. self.namespaces[100] = {'_default':u'Update'} self.namespaces[101] = {'_default':u'Update talk'} self.namespaces[110] = {'_default':u'Forum'} self.namespaces[111] = {'_default':u'Forum talk'}

def path(self, code): return '/index.php' def hostname(self,code): return self.langs[code]

def version(self, code): return "1.9.3" I still need help with this, I can't figure out what's wrong.--Richard (Talk - Contribs) 19:56, 26 April 2007 (UTC)


 * Try adding

console_encoding = 'utf-8'
 * To the end of your user-config.py file. I think it solved issues for other people than just me. It's also a good idea to keep a second Bot account which just has sysop permissions instead of bot, and place that as the sysop bot. Mostly it's useful when running into a protected page. ~Dantman(talk) tricks Apr 26, 2007 @ 20:51 (UTC)

It didn't help. :(--Richard (Talk  - Contribs ) 21:55, 26 April 2007 (UTC)


 * Bot flag, there are a large number of things used to control normal users which hinder a bot's ability to function. That's why the Bot flag exists, most likely that error will go away whenever you get the flag set. Trust me, Dantmanbot has issues running on Central, and I only use that one to alter my userpages. But GaiaBot, and AnimeBot are perfectly fine cause I run them on wiki where they have the Bot flag. ~Dantman(talk) tricks Apr 26, 2007 @ 23:05 (UTC)

Yes! It works! Flagging the bot made it work. Thanks for all the help Dantman.--Richard (Talk - Contribs) 17:15, 27 April 2007 (UTC)