From ArchWiki
Jump to: navigation, search

thestinger's cute little bot.

About this bot

Right now I'm using pywikipediabot/pywikibot, and so far just the scripts that are included (the newer pywikibot has a nicer API but doesn't include all the nice scripts) because they cover almost everything ( lets you use regex).

pywikipediabot/pywikibot archwiki family file:
import family

class Family(family.Family):
    def __init__(self):
        family.Family.__init__(self) = 'archwiki'
        self.langs = {'en':'',

        self.namespaces[1]['ro'] = u'Discuţie'
        self.namespaces[3]['ro'] = u'Discuţie Utilizator'
        self.namespaces[6]['ro'] = u'Fişier'
        self.namespaces[7]['ro'] = u'Discuţie Fişier'
        self.namespaces[9]['ro'] = u'Discuţie MediaWiki'
        self.namespaces[11]['ro'] = u'Discuţie Format'
        self.namespaces[13]['ro'] = u'Discuţie Ajutor'
        self.namespaces[15]['ro'] = u'Discuţie Categorie'

        self.namespaces[4] = {'_default':'ArchWiki',
        self.namespaces[5] = {'_default':'ArchWiki talk',
                              'fr':'Discussion ArchwikiFR',
                              'ro':u'Discuţie ArchWikiRo'}

        self.category_attop = ['en']
        self.interwiki_attop = ['en']

        # Using newlines looks nicer but sometimes creates gaps
        self.category_text_separator = ''
        self.interwiki_text_separator = ''

    def protocol(self, code):
        # The ArchWiki is https only and the bot ignores the redirect
        if code == 'en':
            return "https"
            return "http"

    def scriptpath(self, code):
        return ''

    def version(self, code):
        if code == 'fr':
            return '1.16.2'
        elif code == 'ro':
            return '1.15.5'
            return '1.17.0'

patch to fix the marker not being removed with the category_attop setting (for pywikipediabot, don't know if pywikibot has the same problem since I'm not using it for categories) [I should probably report this upstream, but I'm not sure if the ArchWiki causes the problem]:

--- pywikibot/	2011-09-06 21:49:22.386749427 -0400
+++ pywikibot/	2011-09-06 21:46:31.544743236 -0400
@@ -675,7 +675,7 @@
     s = categoryFormat(new, insite = site)
     if s:
         if site.language() in
-            newtext = s + separator + s2
+            newtext = s + separator + s2.replace(marker, '')
             # calculate what was after the categories links on the page
             firstafter = s2.find(marker)