Manual:Pywikibot/spamremove.py

Script to remove links that are being or have been spammed.

Usage:

spamremove.py www.spammedsite.com

It will use Special:Linksearch to find the pages on the wiki that link to that site, then for each page make a proposed change consisting of removing all the lines where that url occurs. You can choose to:
 * accept the changes as proposed
 * edit the page yourself to remove the offending link
 * not change the page in question

Command line options: -always          Do not ask, but remove the lines automatically. Be very careful in using this option!

-namespace:      Filters the search to a given namespace. If this is specified multiple times it will search all given namespaces

Global arguments available for all bots:

-dir:PATH        Read the bot's configuration data from directory given by PATH, instead of from the default directory.

-lang:xx         Set the language of the wiki you want to work on, overriding the configuration in user-config.py. xx should be the language code.

-family:xyz      Set the family of the wiki you want to work on, e.g. wikipedia, wiktionary, wikitravel, ... This will override the configuration in user-config.py.

-user:xyz        Log in as user 'xyz' instead of the default username.

-daemonize:xyz   Immediately return control to the terminal and redirect stdout and stderr to xyz (only use for bots that require no input from stdin).

-help            Show this help text.

-log             Enable the log file, using the default filename 'spamremove-bot.log' Logs will be stored in the logs subdirectory.

-log:xyz         Enable the log file, using 'xyz' as the filename.

-nolog           Disable the log file (if it is enabled by default).

-maxlag          Sets a new maxlag parameter to a number of seconds. Defer bot edits during periods of database server lag. Default is set by config.py

-putthrottle:n   Set the minimum time (in seconds) the bot will wait between -pt:n            saving pages. -put_throttle:n

-debug:item      Enable the log file and include extensive debugging data -debug           for component "item" (for all components if the second form is used).

-verbose         Have the bot provide additional console output that may be -v                useful in debugging.

-cosmeticchanges Toggles the cosmetic_changes setting made in config.py or -cc               user_config.py to its inverse and overrules it. All other settings and restrictions are untouched.

-simulate        Disables writing to the server. Useful for testing and debugging of new code (if given, doesn't do any real changes, but only shows what would have been changed).

- :n  You may use all given numeric config variables as option and modify it with command line.