views:

173

answers:

2

I have an old machine in my house and one of the things this machine does is detect whether a particular door in the house has just opened or closed.

Right now, I have that machine post a tweet on a private Twitter account.

I would now like to give this machine its own AIM account and have it send me a message on AIM. The only messages that will be sent are literally "front door open" and "front door closed."

It appears that libpurple is a commonly used library for dealing with various instant messaging protocols and is even used in Adium, but it is terribly complicated and I can't figure out how to use it.

Does anybody have or know of a simple code sample that uses libpurple?

+1  A: 

I personally found the source code of Pidgin to be straightforward to read. There are many more IM clients that use libpurple, though, you can check Wikipedia for more details.

smf68
+1  A: 

I've done this sort of thing in a bash script before. Unfortunately the code is lost, but you may want to look at dbus as a piece of the solution. The code was relatively straightforward.

This page on updating pidgin status might be a good starting point.

For your application, it might be as easy as:

purple-remote uri 'aim:goim?screenname=yourimhandle&message="front door open"'

(Watch the quoting!)

See purple-remote(1).

bstpierre