play/type blog

We are creating Germany's juiciest event platform, boomloop.com. Because we love the Internet more than our own mothers. See for yourself. check out boomloop.com


11
Mar

mini: an eventmachine clone of the irc bot they use at last.fm (in 140 lines)

last.fm uses old school irc to connect developers and business people inside the company. the last.fm founder wrote up an article about how they do this with the irccat bot.

…Everyone that works at Last.fm is typically connected to our IRC server. We have different channels per team, as well as a company-wide channel, and a few channels dedicated to automated monitoring. Sometimes it makes much more sense to discuss / ask questions on IRC instead of email, and it’s useful to be able to raise people who are not in the office. That said, the main reason I’m writing this post is to mention the dev-support bot we use: irccat.

i’ve written a ruby eventmachine clone of the irc bot they wrote. it’s called mini, and i tried to keep it as tiny as possible, which was fun :-). using mini…

…you can easily send events to irc from shell scripts:

echo "Ilovethistuffs yes .. i .. do. " | nc localhost 12345 
vmstat | nc localhost 12345
echo "#musicteam,#legal,@alice New album uploaded: ..." | nc somemachine 12345
tail -f /var/log/important.log | nc somemachine 12345

you can also send commands from inside the channels using `?command` syntax. this will invoke a script called minictl on your $PATH.

you can also post to the bot over a url. there’s simple mechanism for adding plugins, as well.

it’s a neat little toy, check out the source on github.

Installation

sudo gem install purzelrakete-mini --source=http://gems.github.com

create a directory for mini and run the following

minigen create 

this creates two files in your mini dir. edit both as you see fit, then add your mini dir to your $PATH inside of your shell’s rc file.

Comments

There are 1 Comment for this post.  Write comment →

Cool project. I can see myself using this in the future. I wanted to leave a comment to mention that the floating footer at the bottom of your page that obscures the article text is horribly annoying from a user interface perspective. It’s cool, but it hurts to read your articles because of it.

My two cents.

Write a comment

Required in bold.