powered by Jive Software

Python: Send message to chat room, Close session

I have been trying all day to get an xmpp message to hit my openfire server but I’ve had absolutely no luck. My use case is to allow my django application to send messages to our support chat room when certain site failures happen.

I have tried xmpppy, sleekxmpp and pyxmpp2. Anyone have any advice?

Requirements:

-connection to the server

-authentication

-logging into chat room

-posting a message

-disconnect

Any help or links would be much appreciated.

Thanks.

I was able to get gmail xmpp messages to work with:

import xmpp

login = ‘<my_address>@gmail.com’ # @gmail.com

pwd = ‘<my_pass>’

jid = xmpp.protocol.JID(login)

cl = xmpp.Client(jid.getDomain(), debug=[])

if cl.connect((‘talk.google.com’,5223)):

print “Connected”

else:

print “Connectioned failed”

if cl.auth(jid.getNode(), pwd):

cl.sendInitPresence()

cl.send(xmpp.Message( “<my_friends_address>@gmail.com” ,“Hello World form Python” ))

else:

print “Authentication failed”

But the exact same code gives me no love with open fire. Has anyone got this to work with xmpp or any other python library?

How to install that xmpp protocol in my machine, I searched a lot for that xmpp package, But i didnt find any result.Please help me, My system is fedora 20