User:HBC AIV helperbot/installation

From Wikipedia, the free encyclopedia

Instructions for installing HBC AIV helperbot[edit]

This bot requires reasonably modern (minimum version 5.6.1) Perl. ActiveState Perl on Windows is known to work, as is Perl 5.8.x on FreeBSD (and thus any UNIX-like system should also work). The installation instructions for Windows are a bit more step-by-step, while basic UNIX system administration knowledge is assumed for those instructions.

Non-technical preparations[edit]

Note This may have already been done for you.

  1. Check for community consensus, we only need 2 or 3 of these bots running at a time.
  2. Discuss with WP:AIV what bot name you will choose, most likely HBC AIV helperbot<number>. Follow the instructions at WP:RFBA for creating an account for the bot.
  3. Follow the instructions at WP:RFBA for getting your bot approved to function.

Software installation[edit]

Pre-Requisites[edit]

  • Perl (ActiveState Perl for Windows is okay)
  • HighInBC's repaired MediaWiki module
  • Perl Modules (available in Windows PPM, CPAN for other platforms):
    • Net::NetMask
  • Perl Modules (not available in PPM, must be installed from CPAN):
    • DateTime
    • DateTime::Format::Duration (may need to force installation due to test failures)
  • make/nmake (Windows users see step-by-step instructions for further information)

Windows[edit]

  1. Download and install ActivePerl - Get the latest version, if you don't know which installer to use, pick MSI, with the highest version number. If you cannot tell which number is higher than another, give up.
  2. Download the repaired version of the MediaWiki module
  3. Find your perl directory, place the contents of mediawiki.rar (after uncompressing it with a utility like WinRAR) into the perl/site/lib/ directory
  4. Create a new folder for the bot to live in, this can be anywhere, this is the bot folder
  5. Create a new file called HBC AIV helperbot.pl in the bot folder
  6. Go here: [1] and copy the script between the <nowiki> tags and place it in HBC AIV helperbot.pl
  7. Run the program called ppm (the perl package manager, it comes with perl) and install the required Perl modules listed above (only "Net::NetMask") (do this by typing install <module> for each module listed, or by selecting them from the graphical user interface).
  8. Download and install nmake from Microsoft. It is available in this knowledgebase article as nmake15.exe
    1. Double-click on the downloaded nmake15.exe. This will extract the files inside into the current directory. Move nmake.exe and nmake.err to your Perl bin directory (usually C:\Perl\bin). You can delete readme.txt and the original nmake15.exe.
  9. Run the CPAN shell by typing cpan from a command shell (you may need to run C:\Perl\bin\cpan if Perl is not in your command PATH. You will be presented with a CPAN prompt that looks like cpan>
    1. The program may ask you several questions the first time you run it. Accept any defaults offered. When it asks you for that path to the make file, give it the full path of nmake.exe.
    2. Type force install DateTime and hit enter. You will be prompted a number of times to install pre-requisite modules, always answer "yes" (this should be the default). Eventually you should see messages indicating that DateTime was successfully installed (even though there were test failures) and you will be returned to the cpan> prompt.
    3. Type force install DateTime::Format::Duration and hit enter. You may again be prompted for pre-requisites, and again, should answer yes. The end result should again be a successful installation message (test failures are fine again, they won't affect our operations), and the cpan> prompt.
    4. Type quit to exit the CPAN shell, and you can now exit your command prompt.
  10. Skip forward to "Common steps" below.

UNIX-like systems[edit]

  1. Install Perl. If you can't figure this out, you shouldn't be running a UNIX system :)
  2. Install the pre-requisite Perl modules listed above (except the repaired MediaWiki module - we'll do that next) using your installation method of choice (the CPAN shell is probably easiest, but if you want to download and install manually, be our guest!)
  3. Download the repaired version of the MediaWiki module
  4. Uncompress the contents of the MediaWiki RAR file into a private lib directory somewhere in your home directory. This can be the same directory that the helperbot will live in, or a different one. I used ~/wikipedia/lib/.
  5. Create a directory for the bot to live in. Again, this can be anything, I used ~/wikipedia/HBC_AIV_helperbot/
  6. Go here: [2] and copy the script between the <nowiki> tags and place them in HBC_AIV_helperbot.pl in your chosen directory.
  7. At the top of the Perl script, you will need to add a shebang line, which should look like #!/usr/bin/perl, with the appropriate path to Perl substituted, and a use lib line to tell the script where to find the MediaWiki module. This should look like use lib '/home/youruser/wikipedia/lib' if you followed my example path above.
  8. Make the script executable, with something like chmod a+x HBC_AIV_helperbot.pl
  9. Continue at "Common steps" below.

Common steps[edit]

  1. Set up username and password files. If I sent you these, use those, otherwise:
    1. Create a new file called username in the bot folder, place the bot's username in this file, do not hit enter after the name
    2. Create a new file called password in the bot folder, place the bot's password in this file, do not hit enter after the password
  2. Log into the account, go to Preferences, and in the Date and Time tab select the time format that looks like: 2001-01-15T16:12:34
  3. Do not use the bot account for any human edits
  4. Now you should be able run the bot. If you are running Windows you just be able to just double click the icon for the HBC AIV helperbot.pl file, for other OSs or from command line, you type perl <scriptname> or just ./<scriptname>.
  5. Monitor the bot's contributions and watch the log to see if it is working properly