• 0

IRC statistics and parsing


Question

So I was redoing a IRC FAQ and was staring at the pisg output that seems to have not changed since 1996. This sent me on a search for a replacement... preferably in PHP instead of Perl. Everything seems deprecated, not updated, completely erased from the internet, or otherwise useless (like being for mIRC, I use HexChat). Even something that can parse a local log file and let me upload it would be nice.

 

Anyone familiar with anything that would work here? 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Yeah the situation is pretty bleak, of course IRC itself is basically frozen in time in the early 90s (Much like PHP, it's a perfect match) so there's no real reason for things to change.

The log file parsing will depend on the client you're using, there's no standard format (Unless you're writing an IRC bot or running a server that you can mod to log, etc.) I'd recommend avoiding regex parsing because that can quickly become a mess* and using structured code to parse a line will be cleaner and easier to update. Then you've got to normalize nicknames to something sane (i.e. tracking changes, using the userid might be better, a mix of userid + nickname would probably be the best though). Once that's done though you can start wiring up the stats code.

*

\[\d{4}-\d{2}-\d{2}T(\d{2}) :(\d{2}):\d{2}\+\d{4}\] (\S+) (\S+) (\S+) ((\S+)\s*(\S+)?\s*(.*)?)
I wrote that and I have no idea what it does.
Link to comment
Share on other sites

This topic is now closed to further replies.