Wikipedia:WPCleaner/Bot tools



WPCleaner provides a few Bot tools:
 * Update of existing disambiguation warning messages on talk pages to inform contributors on the presence of links to disambiguation pages.
 * Update of ISBN warning messages on talk pages to inform contributors on the presence of ISBN errors.
 * Update of duplicate arguments warning messages on talk pages to inform contributors on the presence of duplicate arguments.
 * Make a list of ISBN errors with related articles.
 * Monitor recent changes to detect new disambiguation links.
 * Check Wiki project:
 * Automatic fixing for some errors.
 * Verification of existing errors in articles.
 * Verification of white lists.

Note: These tools are meant to be used only by authorized bots. They can modify a lots of pages in a small amount of time. Use only this functions if you understand perfectly the modifications about to be made. It's your responsibility to ensure that the modifications are correct.

Command line usage
Most of these tools are also available in the command line, so they can be used automatically on a regular basis.

To use WPCleaner from the command line:
 * Download WikipediaCleaner.jar
 * Run WPCleaner with the following command:
 * On Windows,

Where :
 * are possible general options:
 * to define a time limit in seconds for the execution time
 * is the wiki code on which WPCleaner should run (« en » for this wiki)
 * is your user name
 * is your password
 * is the command to run, and  the specific options for the command. Available commands are :
 * to update disambiguation warnings (example on frwiki)
 * to update duplicate arguments warnings (example on frwiki)
 * to update ISBN warnings (example on frwiki)
 * to update the list of ISBN errors
 * to update ISSN warnings (example on frwiki)
 * to update the list of ISSN errors
 * to fix some errors for the Check Wiki project. The options contain error numbers for lists to be analyzed and eventually other errors to be fixed if found in the article.
 * to analyze a MediaWiki dump file to find some errors for the Check Wiki project. The options contain:
 * path to the dump file,
 * path to the directory or files or the name of page, where the result will be stored. Note:   will be replaced by the error number.
 * error numbers for lists to be analyzed.

Update
It's always better to use an up to date version of WPCleaner, and it's even more important when running in bot mode.

The  script below retrieves the last version of WPCleaner on Windows. The  program can be downloaded from the GnuWin32 project.

Repetitive tasks
It's possible to create scripts to do some repetitive tasks.

The  script below automatically fixes error #16 (Control characters).

Running on Toolforge
It's possible to run WPCleaner in bot mode on Toolforge. Details can be found in this Phabricator issue, especially in this comment.

Running on Synology NAS
It's possible to run WPCleaner in bot mode on some NAS, depending on the brand and model of the NAS. This chapter gives an example for Synology NAS (tested with DS411j model).

To run automated tasks with WPCleaner at regular interval, follow the steps below:
 * Install Java (details on the procedure are available at pcloadletter):
 * Check which CPU your NAS has, based on this list (DS411j example: Marvell Kirkwood mv6281 1.2Ghz ARM so ARM).
 * Download Java 7 Embedded for your kind of CPU on Oracle website (DS411j example: ejre-7u55-fcs-b13-linux-arm-sflt-headless-17_mar_2014.tar.gz) and copy it in the shared folder public of your NAS (create this folder if needed)
 * In your NAS package centre, add PCLoadLetter with url http://packages.pcloadletter.co.uk.
 * Install package Java SE Embedded 7.
 * Create the script:
 * Create a dedicated directory for the script (example: /volume1/Divers/WPCleaner/ISBNWarnings)
 * Create the script itself (example : script.sh below to be adapted according to the directory you have chosen and the task to be accomplished). A few explanations:
 * On the first line, use
 * Then use the  command to go in the directory containing the script
 * Update WPCleaner ( and   commands)
 * Run the automated task(s) with WPCleaner (example, update disambiguation warnings)
 * Check that the script works from the command line
 * Schedule the script using the NAS Task Scheduler.
 * Schedule the script using the NAS Task Scheduler.