Weitere Optionen
Rene (Diskussion | Beiträge) →Keine Anzeige von Bot Änderungen: - Jetzt Vorgabe |
K →Bot Quellcode: Navigationsleiste durch Klappbox ersetzt; MW-Version aktualisiert |
||
| (29 dazwischenliegende Versionen von 5 Benutzern werden nicht angezeigt) | |||
| Zeile 1: | Zeile 1: | ||
<div style=" | <div style="float:right; margin-left:5px; padding:5px; width:60%;"> | ||
{{Box|grün|Wichtiges| | |||
* [http:// | * [http://botwiki.sno.cc/wiki/Manual:Bot Programmierung des Bots] | ||
* [http://www.regenechsen.de/phpwcms/index.php?regex_allg Anleitung für RegEx] | * [http://www.regenechsen.de/phpwcms/index.php?regex_allg Anleitung für RegEx] | ||
}} | |||
</div> | </div> | ||
==Willkommen== | |||
Dies ist die Haupt-Benutzerseite der Bots von Stargate Wiki. Es gibt momentan fünf Bots, die sich die Arbeiten teilen. | |||
* PyBot - betrieben durch [[Benutzer:Rene]] | |||
* SilverBot - betrieben durch [[Benutzer:SilverAngel]] | |||
* MacBot - betrieben durch [[Benutzer:Philipp]] | |||
* JanusBot - betrieben durch [[Benutzer:Janus]] | |||
* ColBot - betrieben durch [[Benutzer:Col. o'neill]] | |||
Die Bots sollen hauptsächlich Textersetzungen in Artikeln durchführen. Der Bot kann dabei auf Regular Expressions zurückgreifen. Daher sind auch Aufträge möglich die über einfache "Text1" {{Rechts}} "Text2" Ersetzungen hinausgehen möglich. | |||
Wer Aufträge für die Bots hat, sollte diese bitte auf die [[Benutzer_Diskussion:PyBot|Diskussionsseite]] stellen. Eine Festlegung auf einen bestimmten Bot ist dabei nicht nötig. | |||
Wer | Wer auch einen Bot betreiben will, sieht sich unten die Gebrauchsanweisung an und fügt dann auf seiner Benutzerseite optional die [[Vorlage:Botbabel]] ein. | ||
== | == Anzeige von Bot Änderungen == | ||
Wer die Änderungen der Bots kontrollieren möchte muss auf der Seite [http://www.stargate-wiki.de/w/index.php?title=Spezial:Letzte_%C3%84nderungen&hidebots=0 Letzte Änderungen] «Bots einblenden» anwählen. | |||
==Bot Quellcode == | |||
Den Bot findet man auf dieser [http://botwiki.sno.cc/wiki/Manual:Bot Seite]. Die jeweils letzte Version des Bots findet man auf [http://pywikipediabot.sourceforge.net/ Sourceforge]. Nach der Installation müssen noch die folgenden Dateien hinzufügt werden. | |||
{{Klappbox|TITEL=user-config.py|anfang}} | |||
Im Stammverzeichnis des Bots muss die Datei '''''user-config.py''''' mit folgendem Inhalt erstellt werden. | |||
Für die Werte XXXX (=Benutzername des Bots im Wiki, zB PyBot) und YYYYY (=Benutzername des Admins im Wiki, zB Rene) müssen natürlich die richtigen Namen angegeben werden. Benutzer die keinen Admin-Account haben, oder den Bot damit nicht betreiben möchten, sollten die entsprechende Zeile komplett löschen. | |||
<pre><nowiki> | |||
# -*- coding: utf-8 -*- | |||
# This is an automatically generated file. You can find more configuration parameters in 'config.py' file. | |||
# The family of sites we are working on. wikipedia.py will import | |||
# families/xxx_family.py so if you want to change this variable, | |||
# you need to write such a file. | |||
family = 'stargatewiki' | |||
# The language code of the site we're working on. | |||
mylang = 'de' | |||
# The dictionary usernames should contain a username for each site where you | |||
# have a bot account. | |||
usernames['stargatewiki']['de'] = u'XXXXX' | |||
sysopnames['stargatewiki']['de'] = u'YYYYY' | |||
############## LOGFILE SETTINGS ############## | |||
# Defines for which scripts a logfile should be enabled. Logfiles will be | |||
# saved in the 'logs' subdirectory. | |||
# Example: | |||
# log = ['interwiki', 'weblinkchecker', 'table2wiki'] | |||
# It is also possible to enable logging for all scripts, using this line: | |||
# log = ['*'] | |||
# To disable all logging, use this: | |||
# log = [] | |||
# Per default, logging of interwiki.py is enabled because its logfiles can | |||
# be used to generate so-called warnfiles. | |||
# This setting can be overridden by the -log or -nolog command-line arguments. | |||
log = ['*'] | |||
############## INTERWIKI SETTINGS ############## | |||
# Should interwiki.py report warnings for missing links between foreign | |||
# languages? | |||
interwiki_backlink = False | |||
# Should interwiki.py display every new link it discovers? | |||
interwiki_shownew = True | |||
# Should interwiki.py output a graph PNG file on conflicts? | |||
# You need pydot for this: http://dkbza.org/pydot.html | |||
interwiki_graph = False | |||
# Specifies that the robot should process that amount of subjects at a time, | |||
# only starting to load new pages in the original language when the total | |||
# falls below that number. Default is to process (at least) 100 subjects at | |||
# once. | |||
interwiki_min_subjects = 100 | |||
# If interwiki graphs are enabled, which format(s) should be used? | |||
# Supported formats include png, jpg, ps, and svg. See: | |||
# http://www.graphviz.org/doc/info/output.html | |||
# If you want to also dump the dot files, you can use this in your | |||
# user-config.py: | |||
# interwiki_graph_formats = ['dot', 'png'] | |||
# If you need a PNG image with an HTML image map, use this: | |||
# interwiki_graph_formats = ['png', 'cmap'] | |||
# If you only need SVG images, use: | |||
# interwiki_graph_formats = ['svg'] | |||
interwiki_graph_formats = ['png'] | |||
# You can post the contents of your autonomous_problems.dat to the wiki, | |||
# e.g. to http://de.wikipedia.org/wiki/Wikipedia:Interwiki-Konflikte . | |||
# This allows others to assist you in resolving interwiki problems. | |||
# To help these people, you can upload the interwiki graphs to your | |||
# webspace somewhere. Set the base URL here, e.g.: | |||
# 'http://www.example.org/~yourname/interwiki-graphs/' | |||
interwiki_graph_url = None | |||
# Save file with local articles without interwikis. | |||
without_interwiki = False | |||
############## SOLVE_DISAMBIGUATION SETTINGS ############ | |||
# | |||
# Set disambiguation_comment[FAMILY][LANG] to a non-empty string to override | |||
# the default edit comment for the solve_disambiguation bot. | |||
# Use %s to represent the name of the disambiguation page being treated. | |||
# Example: | |||
# | |||
# disambiguation_comment['wikipedia']['en'] = \ | |||
# "Robot-assisted disambiguation ([[WP:DPL|you can help!]]): %s" | |||
sort_ignore_case = False | |||
############## IMAGE RELATED SETTINGS ############## | |||
# If you set this to True, images will be uploaded to Wikimedia | |||
# Commons by default. | |||
upload_to_commons = False | |||
############## TABLE CONVERSION BOT SETTINGS ############## | |||
# will split long paragraphs for better reading the source. | |||
# only table2wiki.py use it by now | |||
splitLongParagraphs = False | |||
# sometimes HTML-tables are indented for better reading. | |||
# That can do very ugly results. | |||
deIndentTables = True | |||
# table2wiki.py works quite stable, so you might switch to True | |||
table2wikiAskOnlyWarnings = True | |||
table2wikiSkipWarnings = False | |||
############## WEBLINK CHECKER SETTINGS ############## | |||
# How many external links should weblinkchecker.py check at the same time? | |||
# If you have a fast connection, you might want to increase this number so | |||
# that slow servers won't slow you down. | |||
max_external_links = 50 | |||
report_dead_links_on_talk = False | |||
############## DATABASE SETTINGS ############## | |||
db_hostname = '' | |||
db_username = '' | |||
db_password = '' | |||
############## SEARCH ENGINE SETTINGS ############## | |||
# Some scripts allow querying Google via the Google Web API. To use this feature, | |||
# you must install the pyGoogle module from http://pygoogle.sf.net/ and have a | |||
# Google Web API license key. Note that Google doesn't give out license keys | |||
# anymore. | |||
google_key = '' | |||
# Some scripts allow using the Yahoo! Search Web Services. To use this feature, | |||
# you must install the pYsearch module from http://pysearch.sourceforge.net/ | |||
# and get a Yahoo AppID from http://developer.yahoo.com | |||
yahoo_appid = '' | |||
# To use Windows Live Search web service you must get an AppID from | |||
# http://search.msn.com/developer | |||
msn_appid = '' | |||
############## COPYRIGHT SETTINGS ############## | |||
# Enable/disable search engine in copyright.py script | |||
copyright_google = True | |||
copyright_yahoo = True | |||
copyright_msn = False | |||
# Perform a deep check, loading URLs to search if 'Wikipedia' is present. | |||
# This may be useful to improve number of correct results. If you haven't | |||
# a fast connection, you might want to keep they disabled. | |||
copyright_check_in_source_google = False | |||
copyright_check_in_source_yahoo = False | |||
copyright_check_in_source_msn = False | |||
# Web pages may content a Wikipedia text without 'Wikipedia' word but with | |||
# typical '[edit]' tag result of copy & paste procedure. You can want no | |||
# report for this kind of URLs, even if they are copyright violation. | |||
# However, when enabled these URLs are logged in a file. | |||
copyright_check_in_source_section_names = False | |||
# Limit number of queries for page. | |||
copyright_max_query_for_page = 25 | |||
# Skip a specified number of queries | |||
copyright_skip_query = 0 | |||
# Number of attempts on connection error. | |||
copyright_connection_tries = 10 | |||
# Behavior if an exceeded error occur. | |||
# | |||
# Possibilities: | |||
# | |||
# 0 = None | |||
# 1 = Disable search engine | |||
# 2 = Sleep (default) | |||
# 3 = Stop | |||
copyright_exceeded_in_queries = 2 | |||
copyright_exceeded_in_queries_sleep_hours = 6 | |||
# Append last modified date of URL to script result | |||
copyright_show_date = True | |||
# Append length of URL to script result | |||
copyright_show_length = True | |||
# By default the script try to identify and skip text that contents a wide | |||
# comma separated list or only numbers. But sometimes that might be the | |||
# only part unmodified of a slightly edited and not otherwise reported | |||
# copyright violation. You can disable this feature to try to increase | |||
# number of results. | |||
copyright_economize_query = True | |||
############## FURTHER SETTINGS ############## | |||
# The bot can make some additional changes to each page it edits, e.g. fix | |||
# whitespace or positioning of interwiki and category links. | |||
# This is an experimental feature; handle with care and consider re-checking | |||
# each bot edit if enabling this! | |||
cosmetic_changes = False | |||
# If cosmetic changes are switched on, and you also have several accounts at | |||
# projects where you're not familiar with the local conventions, you probably | |||
# only want the bot to do cosmetic changes on your "home" wiki which you | |||
# specified in config.mylang and config.family. | |||
# If you want the bot to also do cosmetic changes when editing a page on a | |||
# foreign wiki, set cosmetic_changes_mylang_only to False, but be careful! | |||
cosmetic_changes_mylang_only = True | |||
# Use the experimental disk cache to prevent huge memory usage | |||
use_diskcache = False | |||
# Retry loading a page on failure (back off 1 minute, 2 minutes, 4 minutes | |||
# up to 30 minutes) | |||
retry_on_fail = True | |||
# End of configuration section | |||
</nowiki></pre> | |||
{{Klappbox|ende}} | |||
{{Klappbox|TITEL=stargatewiki_family.py|anfang}} | |||
Im Verzeichnis '''''families''''' muss die Datei '''''stargatewiki_family.py''''' mit folgendem Inhalt erstellt werden (Achtung: nicht Quelltext der Seite, sondern diese Anzeige kopieren!): | |||
<pre><nowiki> | |||
# -*- coding: utf-8 -*- # REQUIRED | |||
import config, family, urllib # REQUIRED | |||
class Family(family.Family): # REQUIRED | |||
def __init__(self): # REQUIRED | |||
family.Family.__init__(self) # REQUIRED | |||
self.name = 'stargatewiki' # REQUIRED; replace with actual name | |||
self.langs = { # REQUIRED | |||
'de': 'stargate-wiki.de', # Include one line for each wiki in family | |||
} | |||
# Translation used on all wikis for the different namespaces. | |||
# Most namespaces are inherited from family.Family. | |||
# Check the family.py file (in main directory) to see the standard | |||
# namespace translations for each known language. | |||
# You only need to enter translations that differ from the default. | |||
# There are two ways of entering namespace translations. | |||
# 1. If you only need to change the translation of a particular | |||
# namespace for one or two languages, use this format (example): | |||
self.namespaces[-2]['de'] = u'Medium' # REQUIRED | |||
self.namespaces[4]['de'] = u'StargateWiki' # REQUIRED | |||
self.namespaces[5]['de'] = u'StargateWiki Diskussion' # REQUIRED | |||
self.namespaces[6]['de'] = u'Datei' # REQUIRED | |||
self.namespaces[7]['de'] = u'Datei Diskussion' # REQUIRED | |||
self.namespaces[98] = { | |||
'_default': u'Portal', | |||
'de': u'Portal' } | |||
self.namespaces[99] = { | |||
'_default': u'Portal Diskussion', | |||
'de': u'Portal Diskussion' } | |||
self.namespaces[100] = { | |||
'_default': u'Fanprojekt', | |||
'de': u'Fanprojekt' } | |||
self.namespaces[101] = { | |||
'_default': u'Fanprojekt Diskussion', | |||
'de': u'Fanprojekt Diskussion' } | |||
self.namespaces[102] = { | |||
'_default': u'Merchandise', | |||
'de': u'Merchandise' } | |||
self.namespaces[103] = { | |||
'_default': u'Merchandise Diskussion', | |||
'de': u'Merchandise Diskussion' } | |||
self.namespaces[104] = { | |||
'_default': u'Roman', | |||
'de': u'Roman' } | |||
self.namespaces[105] = { | |||
'_default': u'Roman Diskussion', | |||
'de': u'Roman Diskussion' } | |||
self.namespaces[106] = { | |||
'_default': u'Stargate Infinity', | |||
'de': u'Stargate Infinity' } | |||
self.namespaces[107] = { | |||
'_default': u'Stargate Infinity Diskussion', | |||
'de': u'Stargate Infinity Diskussion' } | |||
# no translation for command redirect | |||
# self.redirect['de'] = [u'redirect'] | |||
# Wikimedia wikis all use "bodyContent" as the id of the <div> | |||
# element that contains the actual page content; change this for | |||
# wikis that use something else (e.g., mozilla family) | |||
self.content_id = "bodyContent" | |||
# On most wikis page names must start with a capital letter, but some | |||
# languages don't use this. This should be a list of languages that | |||
# _don't_ require the first letter to be capitalized. Example: | |||
# self.nocapitalize = ['foo', 'bar'] | |||
# SETTINGS FOR WIKIS THAT USE DISAMBIGUATION PAGES: | |||
# Disambiguation template names in different languages; each value | |||
# must be a list, even if there is only one entry. Example: | |||
# self.disambiguationTemplates['en'] = ['disambig', 'disambiguation'] | |||
# The name of the category containing disambiguation | |||
# pages for the various languages. Only one category per language, | |||
# and without the namespace, so add things like: | |||
# self.disambcatname['en'] = "Disambiguation" | |||
# SETTINGS FOR WIKIS THAT USE INTERLANGUAGE LINKS: | |||
# attop is a list of languages that prefer to have the interwiki | |||
# links at the top of the page. Example: | |||
# self.interwiki_attop = ['de', 'xz'] | |||
# on_one_line is a list of languages that want the interwiki links | |||
# one-after-another on a single line. Example: | |||
# self.interwiki_on_one_line = ['aa', 'cc'] | |||
# String used as separator between interwiki links and the text | |||
self.interwiki_text_separator = '\\r\\n\\r\\n' | |||
# Which languages have a special order for putting interlanguage links, | |||
# and what order is it? If a language is not in interwiki_putfirst, | |||
# alphabetical order on language code is used. For languages that are in | |||
# interwiki_putfirst, interwiki_putfirst is checked first, and | |||
# languages are put in the order given there. All other languages are put | |||
# after those, in code-alphabetical order. | |||
self.interwiki_putfirst = {} | |||
# Languages in interwiki_putfirst_doubled should have a number plus a list | |||
# of languages. If there are at least the number of interwiki links, all | |||
# languages in the list should be placed at the front as well as in the | |||
# normal list. | |||
self.interwiki_putfirst_doubled = {} | |||
# Some families, e. g. commons and meta, are not multilingual and | |||
# forward interlanguage links to another family (wikipedia). | |||
# These families can set this variable to the name of the target | |||
# family. | |||
self.interwiki_forward = None | |||
# Which language codes no longer exist and by which language code | |||
# should they be replaced. If for example the language with code xx: | |||
# has been replaced by code yy:, add {'xx':'yy'} to obsolete. | |||
# If all links to language xx: should be removed, add {'xx': None}. | |||
self.obsolete = {} | |||
# SETTINGS FOR CATEGORY LINKS: | |||
# Languages that want the category links at the top of the page | |||
self.category_attop = [] | |||
# languages that want the category links | |||
# one-after-another on a single line | |||
self.category_on_one_line = [] | |||
# String used as separator between category links and the text | |||
self.category_text_separator = '\\r\\n\\r\\n' | |||
# When both at the bottom should categories come after interwikilinks? | |||
self.categories_last = [] | |||
# SETTINGS FOR LDAP AUTHENTICATION | |||
# If your wiki uses: | |||
# http://www.mediawiki.org/wiki/Extension:LDAP_Authentication. | |||
# then uncomment this line and define the user's domain required | |||
# at login. | |||
#self.ldapDomain = 'domain here' | |||
def protocol(self, code): | |||
""" | |||
Can be overridden to return 'https'. Other protocols are not supported. | |||
""" | |||
return 'http' | |||
def scriptpath(self, code): | |||
"""The prefix used to locate scripts on this wiki. | |||
This is the value displayed when you enter {{SCRIPTPATH}} on a | |||
wiki page (often displayed at [[Help:Variables]] if the wiki has | |||
copied the master help page correctly). | |||
The default value is the one used on Wikimedia Foundation wikis, | |||
but needs to be overridden in the family file for any wiki that | |||
uses a different value. | |||
""" | |||
return '/w' | |||
# IMPORTANT: if your wiki does not support the api.php interface, | |||
# you must uncomment the second line of this method: | |||
def apipath(self, code): | |||
# raise NotImplementedError, "%s wiki family does not support api.php" % self.name | |||
return '%s/api.php' % self.scriptpath(code) | |||
# Which version of MediaWiki is used? REQUIRED | |||
def version(self, code): | |||
# Replace with the actual version being run on your wiki | |||
return '1.24.1' | |||
def code2encoding(self, code): | |||
"""Return the encoding for a specific language wiki""" | |||
# Most wikis nowadays use UTF-8, but change this if yours uses | |||
# a different encoding | |||
return 'utf-8' | |||
</nowiki></pre> | |||
{{Klappbox|ende}} | |||