I guess everybody know GoogleTalk right now. Linux users like me knows that it ‘s only a Jabber server with SIP extension. Like a lot of people seems to use this, I decided to switch from MSN(suxTm) to this Jabber server, beside it lacks a lot of Jabber features (like offline messaging )
But, how can I send a message to my Gmail Talk in less 10 lines of code. I decided to look at xmpppy .. Ok I get a strange issue w/ secure login ..
As I already use gajim, I decided to look at this code.. Hum, look strange it has the same xmpp module, with the same API, but this one is working.
import xmpp login = 'Your.Login' # @gmail.com pwd = 'YourPassword' cnx = xmpp.Client('gmail.com') cnx.connect( server=('talk.google.com',5223) ) cnx.auth(login,pwd, 'botty') cnx.send( xmpp.Message( "YourFriend@gmail.com" ,"Hello World form Python" ) )
As you can see this is small and simple :) The only issue is to find the right module, and hope the xmpppy will fix that soon.