rc2udp.py is a service that polls the action API of some MediaWiki-instance periodically, and emity UDP packets for each recent changes item received from the wiki. This emulates XMLRC being installed on that wiki. This way, a setup of the udp2xmpp.py brige, and XMPP server and some client can be tested without having XMLRC actually installed on the wiki.
rc2udp.py is located in the
generator directory of the XMLRC extension. You can place this directory anywhere on your system.
The configuration for rc2udp.py is located in the file
rc2udp.ini in the same directory as rc2udp.py, which uses the INI file syntax. It contains a single section with the following configuration options:
- [rc2udp] contains the configuration for rc2udp.py
- the port to send UDP packet to. Default is 4455. May be overwritten on the command line
- the interval for polling the API, in seconds. Default is 10
- the maximum number of RC items to fetch at once. The default is 500, which is also the maximum number generally allowed by MediaWiki.
- the properties to include in the RC records, as a pipe-separated string, exactly as they would be given for the
rcpropsparameter when accling the API. default is
Once everything is configured, you can start rc2udp.py simply by typing:
python rc2udp.py <target-address>
The <target-address> is the IP address the UDP packets should be send to. Optionally, the port can also be specified, as the second parameter on the command line. If the port is not specified, the
port option from rc2udp.ini will be used. If that is also not defined, the default port 4455 is used.
Since this is a long running process, it's advisable to run rc2udp.py into a screen session on a server.
rc2udp.py supports the following command line options:
- print a help message an exit.
- configuration file to use. If not given, rc2udp.ini will be looked for the the directory where rc2udp.py is located.
- sets verbosity to debug level
- sets verbosity to quiet, only output warnings and errors.