Lately I have been screwing around with XMPP (Jabber) and Ruby. It's pretty slick what you can to fairly easily. The XMPP4R
library makes things cake. Also, Jive's opensource Openfire
XMPP chat server is easy to get up and going. Anywho, here's a quick example of how to connect and login to a chat server using the XMPP4R library:
bot_jid = "USERNAME@SERVER"
bot_pass = "PASSWORD"
client = Jabber::Client.new($bot_jid)
As you can see, we first load the library. Then create a few variables for your credentials. Then we connect using those variables and lastly let everyone know you have logged in.