Le 27/07/13 12:34, Petr Bena a écrit :
It would watch the recentchages of ALL wikis we have
@wm and users
could subscribe (using web browser or some terminal interface) to this
service, so that on certain events (page X was modified), this bot
dispatcher would do something (submit their bot on grid / sent some
signal / tcp packet somewhere / insert data to redis etc etc).
We already such a system! The recent changes entries are formatted as
IRC colorized messages which are sent over UDP and relayed on
irc.wikimedia.org (look at #en.wikipedia).
The related parameters are $wgRC2UDPAddress and $wgRC2UDPPrefix.
So a bot writer can hop on that channel and consume the feed provided there.
It has a few issues though:
1) the system is not resilient (machine die, no more events)
2) messages are not machine friendly
3) there is no schema description to ensure MediaWiki send the format
expected by bots
Ori Livneh has developed EventLogging which sounds to me like a good
replacement for the IRC stream described above. You basically have to
write a JSON schema, then send a query with the key/value you want to
have in the system, it would validate them and send them in a zero mq
system. From there, sub system can subscribe to a stream of messages
and do whatever they want with them (ie write to a database, send irc
notification or pubsub or whatever).
The main advantages of EventLogging are:
a) it is already written
b) it is production grade (monitored, got incident doc etc)
c) it works
d) WMF staff supports it
e) has doc
https://www.mediawiki.org/wiki/Extension:EventLogging/Guide
:-)
--
Antoine "hashar" Musso