Hello all,
I have created a recent changes gateway that reads from IRC and outputs in JSON format. Be aware that the variable None needs to be defined for some packets. This behaviour may change later (by removing parameters that have None as value)
It runs as a simple TCP server on port 8267 (listening only to localhost).
How to use: * connect to localhost:8267 * join channels using 'J <wiki>' (alternatives: jAa) accepted formats: #en.wikipedia, en.wikipedia, en.wikipedia.org eg: J #en.wikipedia J pl.wikipedia J nl.wikipedia.org * part channels using 'P <wiki>' (alternatives: pDdRr) eg: P en.wikipedia P pl.wikipedia.org P #nl.wikipedia
Every wiki has three possible parsed formats; page changed, new page, special (i.e. new user, page move, etc). Some wikis have rcid's included, others don't. If a message cannot be parsed (which generally happens with too long page titles, and unicode page titles like on ja.wikipedia), you will get a raw data message. No encoding conversion is done; everything comes directly from the irc bytestring.
Examples: {"comment": "/* Etymology */ modified the pov", "rcid": None, "title": "Kalarippayattu", "diffsize": "-167", "flags": "", "user": "Bharatveer", "diff": "147842174", "channel": "#en.wikipedia", "oldid": "147835786"}
{"comment": "deleted "[[\x0302Kline"s\x0310]]": a7 no assertion of notability content was: "{{dated prod|concern = {{{concern|Local store, unlikely to be notable.}}}|month = July|day = 29|year = 2007|time = 10:23|timestamp = 20070729102340}}..."", "flags": "delete", "user": "NawlinWiki", "channel": "#en.wikipedia", "title": "Special:Log/delete"}
{"comment": "new stub cat as per wss/p", "title": "Category:Wide receiver, 1950s birth stubs", "diffsize": "+181", "flags": "N", "user": "Waacstats", "channel": "#en.wikipedia"}
and unparseable messages: {"raw": "\x0314[[\x0307FNS27\xe6\x99\x82\xe9\x96\x93\xe3\x83\x86\xe3\x83\xac\xe3\x83\x93 \xe3\x81\xbf\xe3\x82\x93\xe3\x81\xaa\xe2\x80\x9c\xe3\x81\xaa\xe3\x81\xbe\xe3\x81\x8b\xe2\x80\x9d\xe3\x81\xa0\xe3\x81\xa3!\xe3\x82\xa6\xe3\x83\x83\xe3\x82\xad\xe3\x83\xbc!\xe3\x83\x8f\xe3\x83\x83\xe3\x83\x94\xe3\x83\xbc!\xe8\xa5\xbf\xe9\x81\x8a\xe8\xa8\x98!\x0314]]\x034 M\x0310 \x0302http://ja.wikipedia.org/w/index.php?title=FNS27%E6%99%82%E9%96%93%E3%83%86%E... \x035*\x03 \x0303Dream100\x03 \x035*\x03 (+41) \x0310", "channel": "#ja.wikipedia"}
Comments, of course, are welcome. The source is available at http://tools.wikimedia.de/websvn/filedetails.php?repname=valhallasw&path...
--valhallasw
toolserver-l@lists.wikimedia.org