Announcing Firetower – A command-line interface to Campfire

OK, this is pretty early stuff but it’s already usable and I think it has a lot of potential.

BaldMountainLookoutFiretower is a command-line interface to Campfire. It’s currently for Linux systems only, but there’s no reason it can’t be extended to work on OS X as well.

I created it because I needed a command-line interface to Campfire that supported the current streaming Campfire API. I also wanted a bit more flexibility than existing tools provided.

You can read all the details at the Github page, but in a nutshell Firetower provides two services:

  1. A way to post messages and code snippets to Campfire from the command line; and
  2. A daemon which will monitor any number of campfire rooms (in any number of accounts) and take user-configurable action when events (such as new messages) occur.

The latter service is particularly flexible: it can be used to do anything from playing a sound when someone says something in a Campfire room, to implementing IRC-style bots which monitor rooms for keywords and respond accordingly.

For instance, here’s a simple (and HIGHLY UNSAFE!) Ruby eval-bot which you could drop into ~/.firetower/firetower.conf:

receive do |session, event|
  if event['type'] == 'TextMessage' && event['body'] =~ /^!eval (.*)$/
    event.room.account.paste!(event.room.name, "Eval result:n" + eval($1).to_s)
  end
end

Which is triggered when anyone in the room prefaces a message with “!eval”:

campfire_eval2

Patches, suggestions, and bug reports welcome!