Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Good example of using libpurple? [closed]

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?

like image 443
Frank Puccino Avatar asked Jul 27 '10 03:07

Frank Puccino


2 Answers

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.

like image 196
smf68 Avatar answered Sep 23 '22 01:09

smf68


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).

like image 41
bstpierre Avatar answered Sep 23 '22 01:09

bstpierre