How to Setup Google Apps Chat SRV Records For iChat and xmpp4r-simple

I’ve registered several domains using Google Apps. Lately I’ve been fiddling with using Jabber with those domains, and I wanted to have a program be able to interact on IM using an account like tim@example.com. Furthermore, I wanted to have everything Just Work.

The place to start was with DNS. Google has a help page about how to setup your DNS so that your Google Apps accounts can be federated with other non-Google Jabber communities. The problem is that neither xmpp4r-simple nor iChat simply work if I use tim@example.com as my JID. Then I stumbled across this post that connected the dots for me.

Here’s a screenshot of how I setup my SRV records over at eNom:

DNS SRV records for XMPP federation and client setup.

After that, my simple chat listener worked:

require rubygems
require xmpp4r-simple

im = Jabber::Simple.new(tim@example.com, secret-password)
puts im.connected?
im.accept_subscriptions = true

while true
  sleep(5) unless im.received_messages?

  im.received_messages { |msg| puts msg.body if msg.type == :chat }
end

My little “bot” silently accepted new buddy requests, and printed out recent messages every 5 seconds.

UPDATE: Something’s amiss here, I think. I’ll update when I have more details. Guess not. I tried this out on another domain, and thought that things didn’t work right. But I was mistaken. Everything looks good.

Off To RailsConf 2007

In a couple hours I’ll be catching a plane to Portland to attend RailsConf 2007. I’m stoked to hear the presentations, and talk to others that are using Rails every day. It’s gonna be a great Ruby feast, to be sure.

If you want to meet up, contact me through my website or just look for anyone wearing a CodeSmack t-shirt. Chances are good on the first day that it’s me. We’ll have some for sale, so if you wait until Saturday your chances of finding me solely by the t-shirt will be diminished. :-)

I’ll be updating my RailsConf schedule this afternoon and tonight. I’ll try to keep it current during the conference as well. Hope to see you there!

T-Shirt Tuesdays

CodeSmack: Announcing T-Shirt Tuesdays

1. We will design new shirts and release them on Tuesdays
2. We will sometimes feature existing t-shirt designs
3. We will discount the t-shirts featured on Tuesday until the next Tuesday

Head on over and see this week’s newest designs and featured shirts, including one of my new favorite designs: Ready. Fire. Aim. (Hint: listen to its inspiration from RailsConf 2006) Buy ‘em this week and you’ll get a $2.00 discount over normal prices. Enjoy!

Ready. Fire. Aim.