Only you can help us build a free scout media repository!
Please create an account to start uploading your images now.

ScoutMedia:Bot configuration: Difference between revisions

From ScoutMedia, the free scout media repository
mNo edit summary
(Adaptation of the script for use on PfadiWiki.)
Line 1: Line 1:
Here are the text of the configuration files which have to be used on the bots used on the ScoutWiki network scouting wikis.
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 [http://fi.scoutwiki.org PartioWiki] and [http://fr.scoutwiki.org Scoutopedia], but can easily be changed to fit any new Scouting Wiki whose member would like to use a bot on.
Those scripts are now ready only for use on [http://fi.scoutwiki.org PartioWiki], [http://fr.scoutwiki.org Scoutopedia] and [http://www.pfadiwiki.ch PfadiWiki], but can easily be changed to fit any new Scouting Wiki whose member would like to use a bot on.


==user-config.py==
==user-config.py==
Line 7: Line 7:
  mylang                =  'fr'
  mylang                =  'fr'
  mylang                =  'fi'
  mylang                =  'fi'
mylang                =  'de'
  usernames['scoutwiki']['fr'] =  'French name of the Bot'
  usernames['scoutwiki']['fr'] =  'French name of the Bot'
  usernames['scoutwiki']['fi'] =  'Finnish 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 <tt>-lang:XX</tt> option has to be used :  
When using '''login.py''', the <tt>-lang:XX</tt> option has to be used :  
* <tt>~$ python login.py -lang:fr</tt> for loging in on Scoutopedia, then
* <tt>~$ python login.py -lang:fr</tt> for loging in on Scoutopedia
* <tt>~$ python login.py -lang:fi</tt> for loging in on PartioWiki.
* <tt>~$ python login.py -lang:fi</tt> for loging in on PartioWiki
* <tt>~$ python login.py -lang:de</tt> for loging in on Pfadiwiki




Line 37: Line 40:
             'fi':'wiki.partio.net', # PartioWiki
             'fi':'wiki.partio.net', # PartioWiki
             'fr':'www.scoutopedia.net', # Scoutopedia
             'fr':'www.scoutopedia.net', # Scoutopedia
            'de':'www.pfadiwiki.ch', # PfadiWiki
         }
         }
   
   
Line 44: Line 48:
             '_default': u'scoutwiki',
             '_default': u'scoutwiki',
             'fi': u'PartioWiki',
             'fi': u'PartioWiki',
             'fr': u'Scoutopedia'
             'fr': u'Scoutopedia',
            'de': u'Pfadiwiki',
         }
         }
         self.namespaces[5] = {
         self.namespaces[5] = {
Line 50: Line 55:
             'fi': u'Keskustelu PartioWikista',
             'fi': u'Keskustelu PartioWikista',
             'fr': u'Discussion Scoutopedia',
             'fr': u'Discussion Scoutopedia',
            'de': u'Pfadiwiki Diskussion',
         }
         }
   
   

Revision as of 00:04, 7 January 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
        }

        # Most namespaces are inherited from family.Family.

        self.namespaces[4] = {
            '_default': u'scoutwiki',
            'fi': u'PartioWiki',
            'fr': u'Scoutopedia',
            'de': u'Pfadiwiki',
        }
        self.namespaces[5] = {
            '_default': u'Talk about scoutwiki',
            'fi': u'Keskustelu PartioWikista',
            'fr': u'Discussion Scoutopedia',
            'de': u'Pfadiwiki Diskussion',
        }

        #custom namespaces
        self.namespaces[100] = {
            '_default':u'Geocaches',       #Not really geocaches, working with hints, not coordinates
            'fi':u'Lodju'
        }
        self.namespaces[101] = {
            '_default':u'Geocaches talk',
            'fi':u'Keskustelu lodjusta'
        }

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

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