IRC stats for #ubuntu-us-az up

In the past it was possible to get stats on the #ubuntu-us-az IRC channel. That capability was lost a while ago. Its back now. Details are in this post.

For posterity's sake, here is a run-down of how it is done:

  • run irssi to listen to the chat channel. The sole reason for doing this is to get irssi's log file.
  • once a day, run pisg on the log files to create an html file with the stats. They are available under azloco.com/~ircstats.

irssi setup steps:

The configuration file for irssi is found in ~/.irssi/config. It was modified as follows:

  • in the servers variable the following stanza was added:
    {
    address = "irc.freenode.net";
    chatnet = "freenode";
    port = "6667";
    },
  • in the chatnets variable the following stanza was added

    freenet = {
    type = "IRC";
    max_kicks = "4";
    max_msgs = "5";
    max_whois = "4";
    max_query_chans = "5";
    };
  • in the channels variable the following stanza was added

    { name = "#ubuntu-us-az"; chatnet = "freenode"; autojoin = "Yes"; },
  • the settings stanza was modified to be as follows:

    settings = {
    core = { real_name = ""; user_name = "azlocolog"; nick = "azlocolog"; };
    "fe-text" = { actlist_sort = "refnum"; };
    "fe-common/core" = { autolog = "yes"; };
    };

A file startup was created in ~/.irssi with the following content

/set autolog on
/connect irc.freenode.net
/join #ubuntu-us-az

scripts:
Two scripts were created. Both live in ~/bin:

  • make_irc_stats.sh. This script runs once a day to update the stats file
    /irclogs/freenode

    cd ~/public_html
    pisg -ch \#ubuntu-us-az.log -l ~/irclogs/freenode/\#ubuntu-us-az.log -f irssi
  • start_irc_logger.sh

    tmux -2 new-session -s IRC -d
    tmux new-window -t IRC:1 -d 'irssi -d'

crontab additions

The following two lines are added to the crontab file:

45 22 * * * /home/ircstats/bin/make_irc_stats.sh
@reboot /home/ircstats/bin/start_irc_logger.sh

Comments

Just curious did you test this? Does this work?