The Dev Blog

Putting Family Management on Rails!

Ruby and XMPP/Jabber - a Multi Posts Series, Part 1

Posted by Guy Naor Tue, 10 Oct 2006 20:24:00 GMT

Instant Messages is one of the most common apps running on people's desktops. And they have the nice feature of popping up when a new message comes in. Exploiting this programmatically can open up a huge array of options.

In Famundo we added the ability to send alarms notifications to IM addresses. The initial implementation was easy and pretty trivial, given all the samples I found. When I wanted to go further, it became complicated, and there were no more examples to look at. Things like sending rich text messages, or talking to other IM services through XMPP gateways. I promise to show how to just that (and other things) in this series of posts.

I started with Jabber4R, but then realized it's not supported anymore, and all development is now done in XMPP4R. So I switched to it. It is a much more advanced library, and is pretty big. One of the prolems with it is the complexity. Part of it is the inherent complexity of the XMPP protocol. (Though I read somewhere it's simple, don't believe everything you read...)

My goal in this series of posts is to guide you into using XMPP4R to send messages, subscribe to services, send queries, etc... I might get also into receiving messages, though I see it as less important for rails applications. We'll see how much time I have on my hands. If there's something specific you would like me to discuss - let me know.

So lets get starting!

XMPP is a messaging protocol based on XML messages passed between clients and servers. Better known as THE open source for instant messaging protocol/server, is also the protocol used by GoogleTalk. there are also public servers you can subscribe to and use freely. With the right gateways it will let you send messages to all the other major IM networks (AIM, ICQ, MSN and YM). You can read all about it here. The protocol is described in a large collection of RFCs/JEPs and as those usually are, it's a bit of work to decipher them. But I do recommend reading atleast some of them. Depending on what you are trying to achieve.

Another good option are the Jabber/XMPP related books. But be warned they are not that complete, and are not Ruby based. The two I have are Java based:

Programming Jabber

Instant Messaging in Java

The following installments will be:

Part 2: Logging in and sending simple messages to a Jabber/XMPP server

Part 3: Adding html to the messages

Part 4: Queries + Callbacks

Part 5: Presence, or here I am!

Part 6: Sending messages to proprietary networks (AIM, ICQ, MSN, YM)

Tune in for more....

Posted in , ,  | no comments | no trackbacks

del.icio.us:Ruby and XMPP/Jabber - a Multi Posts Series, Part 1 digg:Ruby and XMPP/Jabber - a Multi Posts Series, Part 1 spurl:Ruby and XMPP/Jabber - a Multi Posts Series, Part 1 wists:Ruby and XMPP/Jabber - a Multi Posts Series, Part 1 simpy:Ruby and XMPP/Jabber - a Multi Posts Series, Part 1 newsvine:Ruby and XMPP/Jabber - a Multi Posts Series, Part 1 blinklist:Ruby and XMPP/Jabber - a Multi Posts Series, Part 1 furl:Ruby and XMPP/Jabber - a Multi Posts Series, Part 1 reddit:Ruby and XMPP/Jabber - a Multi Posts Series, Part 1 fark:Ruby and XMPP/Jabber - a Multi Posts Series, Part 1 blogmarks:Ruby and XMPP/Jabber - a Multi Posts Series, Part 1 Y!:Ruby and XMPP/Jabber - a Multi Posts Series, Part 1 smarking:Ruby and XMPP/Jabber - a Multi Posts Series, Part 1 magnolia:Ruby and XMPP/Jabber - a Multi Posts Series, Part 1 segnalo:Ruby and XMPP/Jabber - a Multi Posts Series, Part 1

Comments

Trackbacks

Use the following link to trackback from your own site:
http://devblog.famundo.com/articles/trackback/51

Comments are disabled

Subscribe to The Dev Blog