Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

Michael Ellerbeck http://mellerbeck.blogspot.com/

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

How to send IM jabber message to google chat using python and xmppy

// From http://www.franklinmint.fm/blog/archives/000603.html
// This works with version xmpppy-0.4.0.win32.exe from http://xmpppy.sourceforge.net/
import sys,xmpp

# Google Talk constants
FROM_GMAIL_ID = "user@gmail.com"
GMAIL_PASS = "password"
GTALK_SERVER = "talk.google.com"
TO_GMAIL_ID = "user@gmail.com"

jid=xmpp.protocol.JID(FROM_GMAIL_ID)
cl=xmpp.Client(jid.getDomain(),debug=[])
if not cl.connect((GTALK_SERVER,5222)):
    raise IOError('Can not connect to server.')
if not cl.auth(jid.getNode(),GMAIL_PASS):
    raise IOError('Can not auth with server.')

cl.send( xmpp.Message( "someone@gmail.com" ,"Hi" ) )
cl.disconnect()
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS