Created
February 3, 2012 10:19
-
-
Save afa/1729519 to your computer and use it in GitHub Desktop.
xmpp example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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