I always wondered that there must be a way to catch friends off guard when they are invisible. Luckily I came across Python’s XMPP library which helped me. On ubuntu Linux you can install this module using apt.
1 | $ sudo aptitude install python-xmpp python-dnspython |
The complete script is as below . Open gedit or Vim and copy pate the below code. Save it as “track_invisible_users.py” Don’t forget to replace the username and password fields
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | import xmpp #constants USER_ID = "youruserid@gmail.com" PASSWORD = "yourpassowrd" SERVER = "gmail.com" jid=xmpp.protocol.JID(USER_ID) C=xmpp.Client(jid.getDomain(),debug=[]) if not C.connect((SERVER,5222)): raise IOError('Can not connect to server.') if not C.auth(jid.getNode(),PASSWORD): 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 |
After this run
python track_invisible_users.py



