What is libpurple?
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!