Joe Williams home
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:
require 'xmpp4r/client' bot_jid = "USERNAME@SERVER" bot_pass = "PASSWORD" client = Jabber::Client.new($bot_jid) client.connect client.auth($bot_pass) client.send(Jabber::Presence.new)
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.
Fork me on GitHub