Skip to content

Instantly share code, notes, and snippets.

@CyberShadow
Created May 8, 2010 12:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CyberShadow/394539 to your computer and use it in GitHub Desktop.
Save CyberShadow/394539 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
USERNAME = "thecybershadow" # don't include @gmail.com
PASSWORD = "hunter2"
RESOURCE = "gmail.com"
import sys
if len(sys.argv) < 2:
print 'Usage: python gstatus.py <show> [<status>]'
print ' <show> is either "default" or "dnd"'
print ' <status> is the status string (optional)'
exit()
import warnings
warnings.filterwarnings("ignore") # silence DeprecationWarning messages
from xmpp import *
cl=Client(server='gmail.com',debug=[])
if not cl.connect(server=('talk.google.com',5222)):
raise IOError('Can not connect to server.')
if not cl.auth(USERNAME, PASSWORD, RESOURCE):
raise IOError('Can not auth with server.')
cl.send(Iq('set','google:shared-status', payload=[
Node('show',payload=[sys.argv[1]]),
Node('status',payload=[sys.argv[2] if len(sys.argv)>2 else ""])
]))
cl.disconnect()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment