The ScoutWiki Network server was upgraded on November 20th, 2019. The maintenance is now over. Please inform us in Slack or via email support@scoutwiki.org if you encounter any unexpected errors – it's possible the upgrade has missed something. Thanks and happy scoutwiki'ng!

Difference between revisions of "Bot configuration"

From ScoutWiki Network
Jump to navigation Jump to search
Line 25: Line 25:
 
This script has to be placed in the <tt>/families/</tt> directory of your bot.
 
This script has to be placed in the <tt>/families/</tt> directory of your bot.
  
 +
<pre># -*- coding: utf-8  -*-
 +
import family
  
# -*- coding: utf-8  -*-
+
# ScoutWiki, the international network of scouting wikis.
import family
+
# ScoutWiki, le réseau international de wikis scouts.
+
 
# ScoutWiki, the international network of scouting wikis.
+
class Family(family.Family):
# ScoutWiki, le réseau international de wikis scouts.
+
    def __init__(self):
+
        family.Family.__init__(self)
class Family(family.Family):
+
        self.name = 'scoutwiki'
    def __init__(self):
+
 
        family.Family.__init__(self)
+
        self.langs = {
        self.name = 'scoutwiki'
+
            'fi':'wiki.partio.net', # PartioWiki
+
            'fr':'www.scoutopedia.net', # Scoutopedia
        self.langs = {
+
            'de':'www.pfadiwiki.ch', #PfadiWiki
            'fi':'wiki.partio.net', # PartioWiki
+
            'nl':'www.scoutpedia.nl', #Scoutpedia (NL)
            'fr':'www.scoutopedia.net', # Scoutopedia
+
            'es':'wiki.larocadelconsejo.net', #WikiRoca
            'de':'www.pfadiwiki.ch', # PfadiWiki
+
            'en':'en.scoutwiki.org', #ScoutWiki English
        }
+
            'ar':'ar.scoutwiki.org', #ScoutWiki Arabic
+
            'eo':'eo.scoutwiki.org', #SkoltViko en Esperanto
        # Most namespaces are inherited from family.Family.
+
            'sv':'sv.scoutwiki.org', #ScoutWiki Swedish
+
            'it':'it.scoutwiki.org', #ScoutWiki en italiano
        self.namespaces[4] = {
+
        }
            '_default': u'scoutwiki',
+
 
            'fi': u'PartioWiki',
+
        # Most namespaces are inherited from family.Family.
            'fr': u'Scoutopedia',
+
 
            'de': u'Pfadiwiki',
+
        self.namespaces[4] = {
        }
+
            '_default': u'scoutwiki',
        self.namespaces[5] = {
+
            'fi': u'PartioWiki',
            '_default': u'Talk about scoutwiki',
+
            'fr': u'Scoutopedia',
            'fi': u'Keskustelu PartioWikista',
+
            'de': u'Pfadiwiki',
            'fr': u'Discussion Scoutopedia',
+
            'nl': u'Scoutpedia',
            'de': u'Pfadiwiki Diskussion',
+
            'es': u'WikiRoca',
        }
+
            'en': u'ScoutWiki',
+
            'ar': u'ScoutWiki',
        #custom namespaces
+
            'eo': u'SkoltVikio',
        self.namespaces[100] = {
+
            'sv': u'ScoutWiki',
            '_default':u'Geocaches',      #Not really geocaches, working with hints, not coordinates
+
            'it': u'ScoutWiki',
            'fi':u'Lodju'
+
        }
        }
+
        self.namespaces[5] = {
        self.namespaces[101] = {
+
            '_default': u'Talk about scoutwiki',
            '_default':u'Geocaches talk',
+
            'fi': u'Keskustelu PartioWikista',
            'fi':u'Keskustelu lodjusta'
+
            'fr': u'Discussion Scoutopedia',
        }
+
            'de': u'Pfadiwiki Diskussion',
+
            'nl': u'Overleg Scoutpedia',
    def version(self, code):
+
            'es': u'WikiRoca Discusión',
        return "1.5.6"
+
            'en': u'ScoutWiki talk',
+
            'ar': u'نقاش ScoutWiki',
    def path(self, code):
+
            'eo': u'SkoltVikio diskuto',
        return '/index.php'
+
            'sv': u'ScoutWikidiskussion',
 +
            'it': u'Discussioni ScoutWiki',
 +
        }
 +
 
 +
        #custom namespaces
 +
        self.namespaces[100] = {
 +
            '_default':u'Portal',      #portails
 +
            #'fi':u'Lodju' #Geocache (bug)
 +
            'fr':u'Portail',
 +
            'en':u'Portal',
 +
            'it':u'Portale',
 +
        }
 +
        self.namespaces[101] = {
 +
            '_default':u'Portal talk',
 +
            #'fi':u'Keskustelu lodjusta'
 +
            'fr':u'Discussion Portail',
 +
            'en':u'Portal Talk',
 +
            'it':u'Discussioni portale',
 +
        }
 +
 
 +
    def version(self, code):
 +
        return "1.9.3"
 +
 
 +
    def path(self, code):
 +
        return '/index.php'</pre>
  
 
[[Category:Bot]]
 
[[Category:Bot]]

Revision as of 16:22, 23 August 2007

Here are the text of the configuration files which have to be used on the bots used on the ScoutWiki network scouting wikis.

Those scripts are now ready only for use on PartioWiki, Scoutopedia and PfadiWiki, but can easily be changed to fit any new Scouting Wiki whose member would like to use a bot on.

user-config.py

family                 =  'scoutwiki'
mylang                 =  'fr'
mylang                 =  'fi'
mylang                 =  'de'
usernames['scoutwiki']['fr'] =  'French name of the Bot'
usernames['scoutwiki']['fi'] =  'Finnish name of the Bot'
usernames['scoutwiki']['de'] =  'German (PfadiWiki) name of the Bot'

When using login.py, the -lang:XX option has to be used :

  • ~$ python login.py -lang:fr for loging in on Scoutopedia
  • ~$ python login.py -lang:fi for loging in on PartioWiki
  • ~$ python login.py -lang:de for loging in on Pfadiwiki


When using interwiki.py, the same option is used to tell the bot on which wiki he's got to work first, he'll then check all the pages on that wiki, and after that, if needed, modify the linked pages on the other wiki to have those linked to the first.

Of course, the bot has to be loged on both wikis to be able to write on them ...

scoutwiki_family.py

This script has to be placed in the /families/ directory of your bot.

# -*- coding: utf-8  -*-
import family

# ScoutWiki, the international network of scouting wikis.
# ScoutWiki, le réseau international de wikis scouts.

class Family(family.Family):
    def __init__(self):
        family.Family.__init__(self)
        self.name = 'scoutwiki'

        self.langs = {
            'fi':'wiki.partio.net', # PartioWiki
            'fr':'www.scoutopedia.net', # Scoutopedia
            'de':'www.pfadiwiki.ch', #PfadiWiki
            'nl':'www.scoutpedia.nl', #Scoutpedia (NL)
            'es':'wiki.larocadelconsejo.net', #WikiRoca
            'en':'en.scoutwiki.org', #ScoutWiki English
            'ar':'ar.scoutwiki.org', #ScoutWiki Arabic
            'eo':'eo.scoutwiki.org', #SkoltViko en Esperanto
            'sv':'sv.scoutwiki.org', #ScoutWiki Swedish
            'it':'it.scoutwiki.org', #ScoutWiki en italiano
        }

        # Most namespaces are inherited from family.Family.

        self.namespaces[4] = {
            '_default': u'scoutwiki',
            'fi': u'PartioWiki',
            'fr': u'Scoutopedia',
            'de': u'Pfadiwiki',
            'nl': u'Scoutpedia',
            'es': u'WikiRoca',
            'en': u'ScoutWiki',
            'ar': u'ScoutWiki',
            'eo': u'SkoltVikio',
            'sv': u'ScoutWiki',
            'it': u'ScoutWiki',
        }
        self.namespaces[5] = {
            '_default': u'Talk about scoutwiki',
            'fi': u'Keskustelu PartioWikista',
            'fr': u'Discussion Scoutopedia',
            'de': u'Pfadiwiki Diskussion',
            'nl': u'Overleg Scoutpedia',
            'es': u'WikiRoca Discusión',
            'en': u'ScoutWiki talk',
            'ar': u'نقاش ScoutWiki',
            'eo': u'SkoltVikio diskuto',
            'sv': u'ScoutWikidiskussion',
            'it': u'Discussioni ScoutWiki',
        }

        #custom namespaces
        self.namespaces[100] = {
            '_default':u'Portal',       #portails
            #'fi':u'Lodju' #Geocache (bug)
            'fr':u'Portail',
            'en':u'Portal',
            'it':u'Portale',
        }
        self.namespaces[101] = {
            '_default':u'Portal talk',
            #'fi':u'Keskustelu lodjusta'
            'fr':u'Discussion Portail',
            'en':u'Portal Talk',
            'it':u'Discussioni portale',
        }

    def version(self, code):
        return "1.9.3"

    def path(self, code):
        return '/index.php'