How can I update my gmail status programmatically?
GTalk uses an xmpp based protocol, you can find libraries which implement the protocol and do what you want to do. You might also want to look at http://xmpp.org/rfcs/rfc3922.html, in particular at the tag. The xmpp server you want is talk.google.com port 5222. http://code.google.com/apis/talk/open_communications.html has more general information.