[Mediawiki-l] Recent Changes UDP Announcement IRC Bot

Platonides Platonides at gmail.com
Sat Sep 12 22:26:48 UTC 2009


APseudoUtopia wrote:
> The regex I have now is:
> /Wiki: [0-9]{2}\[\[[0-9]{2}(.+)[0-9]{2}\]\].*(http:\/\/domain.tld\/wiki\/index.php.+)
> [0-9]\* [0-9]{2}(.+) [0-9]\* .+ [0-9]{2}(.*)/

Those numbers are prepended by byte 3 (irc code introducing a color).


>>> The string sent to the socket is something like:
>>> Wiki: 14[[07To Do14]]4 10
>>> 02http://domain.tld/wiki/index.php?diff=230&oldid=201 5* 03Username 5*
>>> (-45) 10Removed IRC line; added something else
>>>
>> aren't those color codes for IRC?
>>
>> henna/Finne
>>
> 
> Ah, I suppose they are. I generally dislike using colors on IRC
> because the client I use doesn't manage colors well (And colors aren't
> even part of the RFC..

It's defined at http://www.mirc.com/help/color.txt
MediaWiki udp stream doesn't use background colors, so check for a
character 3 followed by 1 or two digits.


> ). Anyway, is there any way to strip these color codes out? I didn't
> see a configuration value anywhere in the docs for it.
> 
> Actually, could someone point to me the file which generates this RC
> announcement message, and I can edit it in MW instead of parsing it
> with a regex?
> 
> Thanks.

Those colors *are* useful.
They delimit the fields, even when they are empty.
So for example the 4 10 you see are above a field which can be an action
written in lowercase (move, block...) or capital letters, in which case
they are flags (currently defined NMB: New, Minor and Bot).

Without the colors, you wouldn't be able to differenciate the fields on
some corner cases, like an username designed to trick you.




More information about the MediaWiki-l mailing list