Have anybody thought for security issue as password is in plaintext format !!

Try this.:)

#gtalk1.py
#Based on script  by "Tha.Suresh" (sent to ILUGC mailing list)
#modified by Ashish Bhatia

import xmpp
import getpass

# Google Talk
FROM_GMAIL_ID = raw_input("Enter gmail ID:")
GMAIL_PASS = getpass.getpass("Enter Password:")
GTALK_SERVER = "gmail.com"

jid=xmpp.protocol.JID(FROM_GMAIL_ID)
C=xmpp.Client(jid.getDomain(),debug=[])

if not C.connect((GTALK_SERVER,5222)):
  raise IOError('Can not connect to server.')
if not C.auth(jid.getNode(),GMAIL_PASS):
  raise IOError('Can not auth with server.')

C.sendInitPresence(requestRoster=1)

def myPresenceHandler(con, event):
 if event.getType() == 'unavailable':
   print event.getFrom().getStripped()

C.RegisterHandler('presence', myPresenceHandler)
while C.Process(1):
 pass

Mr.Ashish Bhatia modified it a bit, so that, user does not have to
keep password in the file.
It asks for username and password on the start.


Thanks to Mr.Ashish Bhatia
IIT Kanpur.
www.ashishb.net


-- 
Regards,
Tha.Suresh

Kanchi Linux User Group Rocks !!!!
http://kanchilug.wordpress.com

My experiences with Linux are here,
http://thasulinux.wordpress.com

-- 
l...@iitd - http://tinyurl.com/ycueutm

Reply via email to