rubygoogle-apixmppgoogle-talkxmpp4r

are there any APIs for changing google-talk status?


I want to write an application, which will:

So, when I open my gmail interface, I see list with my contacts on the left side of page. I can open chat with people from this list, I can change status and name (near my little google+ avatar).

When I write status or name, I meen special message 'Bogdan' on this picture

Is exists some Google API for changing google-talk status (special message)? Can I do it using some RubyOnRails gems? Thanks.


Solution

  • So, this pretty lines of ruby code ( using xmpp4r gem ), change your google_talk status and send chat_message to your friend. Thank you, @Arkan!

    require 'xmpp4r'
    
    # init jabber client
    client_jid = Jabber::JID.new( 'your_email@gmail.com' )
    client     = Jabber::Client.new( client_jid )
    client.connect 'talk.google.com'
    client.auth 'your_gmail_password'
    
    # change google_talk status
    client.send( Jabber::Presence.new.set_show( :chat ).set_status( 'Your New GoogleTalk status' ) )
    
    # send chat_message to friend
    friend  = Jabber::JID.new("your_friend_email@gmail.com")    
    message = Jabber::Message::new(friend, "it's chat message").set_type(:normal).set_id('1')
    client.send(message)
    

    I love ruby ^_^ !