From: Norman R. <no...@ra...> - 2010-11-13 23:06:44
|
On Fri, Oct 29, 2010 at 4:26 AM, salil GK <gk...@gm...> wrote: > Hello > > This is my first post to this mailing list. I am trying to make my bot > using xmpppy and found that connect is failing. The following is what I am > doing. > > ------ > [root@localhost GMAIL]# cat test1.py > #!/usr/bin/python > # $Id: xsend.py,v 1.8 2006/10/06 12:30:42 normanr Exp $ > import sys,os,xmpp,time > > if len(sys.argv) < 2: > print "Syntax: xsend JID text" > sys.exit(0) > > tojid=sys.argv[1] > text=' '.join(sys.argv[2:]) > > jidparams={'jid':'gk...@gm... <jid%27%3A%27g...@gm...> > ','password':'password'} > > jid=xmpp.protocol.JID(jidparams['jid']) > print jid > cl=xmpp.Client(jid.getDomain(),debug=[]) > try: cl=xmpp.Client('talk.google.com',debug=[]) also can try removing ,debug=[] to get extra information about the connection. print cl > > con=cl.connect() > if not con: > print 'could not connect!' > sys.exit() > print 'connected with',con > > > auth=cl.auth(jid.getNode(),jidparams['password'],resource=jid.getResource()) > if not auth: > print 'could not authenticate!' > sys.exit() > print 'authenticated using',auth > > #cl.SendInitPresence(requestRoster=0) # you may need to uncomment this > for old server > id=cl.send(xmpp.protocol.Message(tojid,text)) > print 'sent message with id',id > > time.sleep(1) # some older servers will not send the message if you > disconnect immediately after sending > > #cl.disconnect() > > ------- > > [root@localhost GMAIL]# ./test1.py 1 2 > \/usr/lib/python2.6/site-packages/xmpppy-0.5.0rc1-py2.6.egg/xmpp/auth.py:24: > DeprecationWarning: the sha module is deprecated; use the hashlib module > instead > /usr/lib/python2.6/site-packages/xmpppy-0.5.0rc1-py2.6.egg/xmpp/auth.py:26: > DeprecationWarning: the md5 module is deprecated; use hashlib instead > gk...@gm... > <xmpp.client.Client instance at 0xb7c9ffec> > could not connect! > You have new mail in /var/spool/mail/root > > > > --------- > > What could be the issue here. I have internet access in this machine and I > can ping google site from there. > > Thanks > Salil > > > ------------------------------------------------------------------------------ > Nokia and AT&T present the 2010 Calling All Innovators-North America > contest > Create new apps & games for the Nokia N8 for consumers in U.S. and Canada > $10 million total in prizes - $4M cash, 500 devices, nearly $6M in > marketing > Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store > http://p.sf.net/sfu/nokia-dev2dev > _______________________________________________ > Xmpppy-devel mailing list > Xmp...@li... > https://lists.sourceforge.net/lists/listinfo/xmpppy-devel > > -- - Norman Rasmussen - Email: no...@ra... - Home page: http://norman.rasmussen.co.za/ |