Skip to content

Commit

Permalink
get current user for oauth
Browse files Browse the repository at this point in the history
  • Loading branch information
chebyte committed Nov 25, 2010
1 parent 22bfb4a commit 55984e8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/youtube_it/client.rb
Expand Up @@ -226,6 +226,11 @@ def authorize_from_access(atoken,asecret)
@atoken,@asecret = atoken, asecret
end

def current_user
body = access_token.get("http://gdata.youtube.com/feeds/api/users/default").body
REXML::Document.new(body).elements["entry"].elements['author'].elements['name'].text
end

private

def client
Expand Down

0 comments on commit 55984e8

Please sign in to comment.