Skip to content

Instantly share code, notes, and snippets.

@linuxoid69
Created July 16, 2015 14:48
Show Gist options
  • Save linuxoid69/6e6e7b30f75dcc569e81 to your computer and use it in GitHub Desktop.
Save linuxoid69/6e6e7b30f75dcc569e81 to your computer and use it in GitHub Desktop.
jabber cli
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import xmpp,sys
xmpp_jid = 'noreply@some.jabber.server'
xmpp_pwd = 'noreplypass'
to = sys.argv[1]
msg = sys.argv[2]
jid = xmpp.protocol.JID(xmpp_jid)
client = xmpp.Client(jid.getDomain(),debug=[])
client.connect()
client.auth(jid.getNode(),str(xmpp_pwd),resource='xmpppy')
client.send(xmpp.protocol.Message(to,msg))
client.disconnect()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment