Skip to content

Instantly share code, notes, and snippets.

@afa
Created February 3, 2012 10:19
Show Gist options
  • Save afa/1729519 to your computer and use it in GitHub Desktop.
Save afa/1729519 to your computer and use it in GitHub Desktop.
xmpp example
require 'rubygems'
require 'xmpp4r/client'
include Jabber
server, login, password = "qip.ru", "my_login", "my_password"
to, subject, body = "someone@qip.ru", "XMPP4R test", "Hi, this is my first try from XMPP4R!!!"
Jabber::debug = true
jid=JID::new "#{login}@#{server}"
cl = Client::new(jid)
cl.connect
cl.auth password
m = Message::new(to, body).set_type(:normal).set_id('1').set_subject(subject)
cl.send m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment