just save this code in your system as gchat.py
then open ur terminal in ubuntu and type
sudo aptitude install python-xmpp python-dnspython
then after the installation type
python gchat.py
this list of friends name will be displayed
//gchat.py
import xmpp
# Google Talk constants
FROM_GMAIL_ID = "email"
GMAIL_PASS = "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
