Search code examples
rubytwittergrackle

Twitter + Grackle, determining the logged in user


This is crazy, but I'm stumped! Once my user has logged into twitter via OAuth how do I determine their username using grackle?

@twitter = Grackle::Client.new(:auth => {
  :type => :oauth,
  :consumer_key => consumer_key,
  :consumer_secret => consumer_secret,
  :token => @access_token.token, 
  :token_secret => @access_token.secret
})

username = @twitter.something_here?

Solution

  • Try looking on here:

    http://apiwiki.twitter.com/Twitter-REST-API-Method:-account%C2%A0verify_credentials

    It tells you how via the main api how to get the current user information. You could look into hooking this up through Grackle.

    Joe