VandalSniper and IRC: better together!

I spent much of the today integrating SmartIrc4net with VandalSniper. No, VandalSniper doesn’t let you chat on IRC now. It connects to the Wikimedia IRC server and joins the Wikipedia “recent changes” channel, which gets spammed by a bot every time any change is made to Wikipedia.

Which means that we can not only save Wikipedia’s bandwidth, but we can update the UI in realtime!

So far the sniper is the only function that uses this live feed. The previous approach has been to go over the “hitlist” in round-robin fashion, checking one user every 5 seconds. This means that if you’re monitoring 6 people, it will take 30 seconds to check everyone! While sluggish, I used this approach to conserve bandwidth and CPU on both ends of the connection. But now, by passively monitoring an IRC channel, the sniper never needs to contact Wikipedia directly, and can display edits in realtime!

Currently the recent changes tab functions as before. I’m still not sure if feeding the IRC stream into the box live is a great idea, as it will be very distracting and won’t give people enough time to check each edit. But I may cache the last 100 or so edits that come out of the stream, and use that cache when refreshing the stream. This would make the refresh immediate, and it wouldn’t require a trip to Special:Recentchanges.

There are only 113 lines in Irc.cs, which is responsible for setting up the IRC connection, converting channel messages into Change objects. and passing these objects off to an event.