import datetime import getpass import logging import sys import arkbot import utils if __name__ == "__main__": print "CatDump 0.1" print "(C) 2010 Arkanosis" print "*****@*****.**" print recursive = utils.getOption("R") categories = utils.getOption("C") if len(sys.argv) != 3: print "Usage: catdump.py [-R] [-C] <category> <outputFile>" sys.exit(1) date = datetime.datetime.now() logger = logging.getLogger("ArkbotLogger") formatter = logging.Formatter("%(asctime)s - %(levelname)s - %(message)s", "%H:%M:%S") logger.setLevel(logging.INFO) bot = arkbot.Arkbot(arkbot._botName, arkbot._wiki, logger) try: # bot.login(getpass.getpass('Bot password ? '))
import datetime import getpass import logging import sys import arkbot import utils if __name__ == '__main__': print 'Models 0.1' print '(C) 2010 Arkanosis' print '*****@*****.**' print publish = utils.getOption('publish') test = utils.getOption('test') if test: publish = False if len(sys.argv) != 2: print 'Usage: models.py [-publish|-test] <category>' sys.exit(1) date = datetime.datetime.now() logger = logging.getLogger('ArkbotLogger') formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s', '%H:%M:%S') logger.setLevel(logging.INFO) bot = arkbot.Arkbot(arkbot._botName, arkbot._wiki, logger) try:
import subprocess import os import shutil from time import sleep import sys from utils import parseOptions from utils import getOption parseOptions() DEBUG = getOption("debug") WIDTH = str(30) HEIGHT = str(30) DEFAULT_NEG = 1000 DEFAULT_POS = 500 DEFAULT_STAGES = str(20) USE_USER_IMG_NUM = False if getOption("width") != None: WIDTH = getOption("width") if getOption("height") != None: HEIGHT = getOption("height") if getOption("num_stages") != None: DEFAULT_STAGES = getOption("num_stages") if getOption("images") != None: USE_USER_IMG_NUM = True DEFAULT_POS = int(getOption("images")) DEFAULT_NEG = DEFAULT_POS * 2 GEN_FOLDER = "generated" NEGATIVES_FOLDER = "negatives/"
if lastPage != sys.maxint: for pageNumber in xrange(max(firstPage, pageNumber), lastPage + 1): clearPage(bot, dump, pageNumber, debug, firstPage, lastPage, root, summary, introPath) if mode in [1, 4, 7, 8, 9, 10, 11, 12, 13]: editOrDebug(bot, 'Modèle:Palette %s' % subject, '%s au %s' % (summary, dump), model, debug, botEdit=True) if __name__ == '__main__': print 'NoPortal 0.1' print '(C) 2010 Arkanosis' print '*****@*****.**' print dump = utils.getValue('dump') mode = int(utils.getValue('mode')) debug = utils.getOption('debug') if len(sys.argv) != 2: print 'Usage: noportal.py -dump <dumpDate> -mode <mode> [-debug] <fichier>' sys.exit(1) date = datetime.datetime.now() logger = logging.getLogger('ArkbotLogger') formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s', '%H:%M:%S') logger.setLevel(logging.INFO) bot = arkbot.Arkbot(arkbot._botName, arkbot._wiki, logger) try: if not debug: bot.login(getpass.getpass('Bot password ? '))
import re import sys import arkbot import utils _bot = re.compile(r'u\'\|(?P<bot>[^}]+)') _trainer = re.compile(r'\[\[Utilisateur:(?P<trainer>[^\|/\]]+)') if __name__ == '__main__': print 'BotMail 0.1' print '(C) 2010 Arkanosis' print '*****@*****.**' print publish = utils.getOption('publish') if len(sys.argv) != 1: print 'Usage: botmail.py [-publish]' sys.exit(1) date = datetime.datetime.now() logger = logging.getLogger('ArkbotLogger') formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s', '%H:%M:%S') logger.setLevel(logging.INFO) bot = arkbot.Arkbot(arkbot._botName, arkbot._wiki, logger) try: if publish: bot.login(getpass.getpass('Bot password ? '))
import subprocess import sys import arkbot import utils _webBrowser = 'firefox' _diffUrl = 'https://fr.wikipedia.org/w/index.php?title=%s&diff=%s&oldid=%s' if __name__ == '__main__': print 'CopyTraq 0.2' print '(C) 2010 Arkanosis' print '*****@*****.**' print botflag = utils.getOption('botflag') timestamp = '2000-01-01T00:00:00Z' if len(sys.argv) == 3: timestamp = sys.argv[-1] sys.argv.remove(timestamp) if len(sys.argv) != 2: print 'Usage: copytraq.py [-botflag] <nbChanges> [timestamp]' sys.exit(1) date = datetime.datetime.now() logger = logging.getLogger('ArkbotLogger') formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s', '%H:%M:%S') logger.setLevel(logging.INFO)
result += '* %s — %s\n' % (winner, votes[0][winner]) else: result += '\nPas de vainqueur potentiel {{=/}}.\n' return result # while len(votes.items()) == 1: # votes = votes.values()[0] return '== Décompte%s des votes au %s %s %s à {{Heure|%s|%s}} ==\n' % (temp, date.day, arkbot._monthName[date.month - 1], date.year, str(date.hour).zfill(2), str(date.minute).zfill(2)) + recResults(votes) if __name__ == '__main__': print 'VoteScrapper 0.2' print '(C) 2010 Arkanosis' print '*****@*****.**' print temp = utils.getOption('temp', ' \'\'\'provisoire\'\'\'', '') publish = utils.getOption('publish') test = utils.getOption('test') if test: publish = False reminder = utils.getOption('poll', ' (rappel : ceci \'\'n\'est pas\'\' une prise de décision)', '') if len(sys.argv) != 2: print 'Usage: votescrapper.py [-temp] [-poll] [-publish|-test] <Wikipédia:Page de vote>' sys.exit(1) date = datetime.datetime.now() logger = logging.getLogger('ArkbotLogger') formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s', '%H:%M:%S') logger.setLevel(logging.INFO)