Archive for the ‘ Information ’ Category

What is libpurple?

Libpurple picture

Okay, so starting things off, what the heck is libpurple??

If you google a definition for libpurple, you’ll get something like, “Pidgin (formerly named Gaim) is a multi-platform instant messaging client, based on a library named libpurple.”

So basically, libpurple is a programming interface for instant messaging over various networks (such as AIM, Yahoo, MSN, ICQ, etc.). Pidgin, on the other hand, is an instant messaging application that uses libpurple and includes a GUI (graphical user interface) for all us normal people out there.

What can you do with libpurple, you ask? Lots of nifty stuff.

Since libpurple is essentially an API, pretty much anything your instant messenger can do, you can do programmatically using libpurple. Want to make your own IM robot? Go ahead! I’ll show you how.

Does it require anything special?

All you need is an installation of libpurple on whatever system it’s going to run on and an IM account on pretty much any network, and that’s about it. (And you don’t need to register your IM account as a bot). Since libpurple is written in C, your programs will have to be written in C as well. If you’re not a pro in C, don’t panic. I never used C a day in my life until I wrote an instant messaging program using libpurple. Fortunately, libpurple is pretty easy to understand once you get the hang of it. Trust me on this one.

Since I am mostly a web developer, I am going to show you how to create and run IM programs on a Linux server over the command line. If you are a light web developer with your own website, but you don’t have access to the command line on your server (say, if you have a shared web server…), you’re going to need either a virtual private server or a dedicated server OR if you have just any old computer laying around, you can use that too! All you need is administrative access on that computer/server.

Who uses libpurple?

Probably one of the most notable applications of libpurple on the web is meebo.com. They provide a web-based instant messaging service for several different networks, including Facebook Chat (yes, you can do Facbeook Chat too). For a full list of who uses libpurple, you can go here.

Who created libpurple?

Not me! Sorry to disappoint you. It was actually made by these guys http://pidgin.im/. I just use libpurple for real world applications over the web. I’m just a normal guy, not a pro in libpurple, but I have learned many things the hard way because of such little documentation on this. If you go searching for tutorials on how to use libpurple, this is about the best you’ll find:

Your application will first initialize the core (purple_core_init), add plugin-search paths, load the saved plugins, prefs etc. Your best bet is to check out a copy of the source code and look at finch/finch.c:init_libpurple().

(stright from the Pidgin website)

As you can see, not very helpful…so that’s why I’m here, to contribute what I wish I had a looong time ago.

Next up: Tutorials!

It’s alive!

I am proud to announce the launch of libpurple.com today (May 18, 2010)! What are we going to do, you ask? Well if you must know…

If you haven’t noticed already, there are very little resources out on the web to help new developers program with libpurple (which by the way is an instant messaging C library, for those of you who don’t know). So with such little help, what do you do? This is where we would like to come in.

As an experienced developer in libpurple (and many web programming languages and databases), I would like to share with everyone what I know about libpurple and how to use it in real applications. I plan on providing tutorials and how-to’s written for normal people in layman’s terms so that everyone and anyone could understand it. Also, with our blog-like interface, I hope to get some potential contributions from other users as well.

In short, we want to be your #1 resource for instant message application programming tutorials and how-to’s!

By the way, I like to say “we” a lot, but this is really a one manned job. I just think “I” sounds too conceited :p

-Michael C. Brook