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/
   1  
   2  import sys,xmpp
   3  
   4  # Google Talk constants
   5  FROM_GMAIL_ID = "user@gmail.com"
   6  GMAIL_PASS = "password"
   7  GTALK_SERVER = "talk.google.com"
   8  TO_GMAIL_ID = "user@gmail.com"
   9  
  10  jid=xmpp.protocol.JID(FROM_GMAIL_ID)
  11  cl=xmpp.Client(jid.getDomain(),debug=[])
  12  if not cl.connect((GTALK_SERVER,5222)):
  13      raise IOError('Can not connect to server.')
  14  if not cl.auth(jid.getNode(),GMAIL_PASS):
  15      raise IOError('Can not auth with server.')
  16  
  17  cl.send( xmpp.Message( "someone@gmail.com" ,"Hi" ) )
  18  cl.disconnect()
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS