Obsolete:Wprc

From Wikitech
This page contains historical information. It may be outdated or unreliable.

The recent changes IRC bot for this wiki (http://wp.wikidev.net/), runs on the same server as the wiki, and connects to a freenode IRC server via the IRC forwarding on zwinger. Update: now uses a ssh tunnel to another wikidev server which isn't blocked on the irc ports. Gwicke 01:02, 9 Jan 2005 (UTC) It has to do this because gwicke's hoster seems to block outbound access to TCP port 6667.

This is now also used for wikipedia with a different setup. The bot is available on sourceforge:

cvs.sourceforge.net/cvsroot/wikipedia phase3/irc

The scripts are installed on vincent server in /home/wikipedia/common/php-new/irc

The bot comes in two part:

  1. a stream script using the php script rcdumper.php to get datas from the wiki
  2. the python bot itself that read the generated data and output them to server

Dumping datas

To start dumping datas, su as apache and start the main script

/home/wikipedia/common/php-1.4/irc/allrc.sh

It will initialise the bot that reads data from temporary streams. The bots are launched every 30 seconds so you have to wait 5 minutes to get them all online. Once it is done, the script start the rcdumper.php script that will feed the bots.

rcdumper.php

Usage:

php rcdumper.php <lang> <sitename> -m <#channel> <1st letter> <2nd letter>

Where:

lang
is the language of the wiki (en de fr gu eo ...)
sitename
is the sitename (wikipedia, wiktionary ...)
#channel
is the irc channel, don't forget the '#' (ex: #enrc.wikipedia )
1st letter and 2nd letter
will tell the script to restrict changes dump to articles that begin by a letter included between 1st and 2nd letter (ex: A Z to get all changes).

The output of the script should be piped to an irc client. Instead we use the stream script that write the output in file. The python bot can then read datas from the files.