XA4PPR with Jabber for in band registration

xmpp4r gem
jid = Jabber::JID::new('admin@ejabberd.server.com/res')
client = Jabber::Client::new(jid)
client.connect
client.auth("admin_password")

iqr = Jabber::Iq.new(:set)
qr = Jabber::IqQuery.new
qr.add_namespace('jabber:iq:register')
username = 'nishant'
password = 'nishant'
qr.add(REXML::Element.new('username').add_text(username))
qr.add(REXML::Element.new('password').add_text(password))
iqr.add(qr)
client.send iqr

Comments

Popular posts from this blog

Inserting and Moving elements inside Ruby Array

Remove duplicates from a JavaScript Array

Sending Binary Data over the Network with Json