Using Instant Message Technology for Business
Posted on February 17th, 2006 under Code, RallyClock.
This article will review how we came up with a new use for Jabber (Instant Message) technology to keep track of our time.
(Update: This is a precursor to our efforts in creating the RallyClock time-tracking system.)
Time entry is the inventory for any consulting firm. It is also one of the most painful administrative tasks. We’ve gone through spreadsheets to web-applications to pen & paper, and nothing seemed to quite work.
We use IM on a daily basis to interact with out clients, partners and consultants and thought it would be neat idea to make an IM-Bot (Instant Message Robot) that would record our time and respond to a few commands. Here’s how we did it.
Starting with a Client for our IM-Bot
We started using Jarl, a perl-based IM client. Jarl is a bit old, but it was attractive to us because it was written in perl and has a command-line interface (there is a graphical TK interface, but we opted for the command line). And we wanted to use the Jabber protocol, because it is an open standard.
The theory was to intercept the incoming messages, process them, and then execute commands and then return results to the use via an immediate IM response message.
Intercepting the Messages
We wrote a fairly simple perl library to intercept the message and process it for know commands (or methods). This library could be integrated into and perl-based Jabber client and uses the perl Net::Jabber (specifically the client routines). These messages go through a simple regex-based translation layer that maps IM messages to commands we’d like to execute.
my ($cmnd, @args) = split(/s/, $message->GetBody());
$cmnd = "_" . uc($cmnd);
In this listing $message is a Net::Jabber message object. For each command in our library, we have a routine. So “show entries” would be translated from the code above to run a method called _SHOW with the argument entries.
That’s the basic concept and how we’ve been logging our time for the last year.
