Permalink
Browse files

upgrade readme

  • Loading branch information...
1 parent 7de73a9 commit fadc8778eb6c865ece83000beca69253c624a33b @chebyte chebyte committed Feb 23, 2012
Showing with 6 additions and 6 deletions.
  1. +1 −1 README.rdoc
  2. +5 −5 lib/youtube_it/client.rb
View
@@ -52,7 +52,7 @@ Client with OAuth:
$ client.authorize_from_access("access_token", "access_secret")
Client with OAuth2:
- $ client = YouTubeIt::OAuth2Client.new(client_access_token: "access_token", client_refresh_token: "refresh_token", client_id: "client_id", client_secret: "client_secret", dev_key: "dev_key")
+ $ client = YouTubeIt::OAuth2Client.new(client_access_token: "access_token", client_refresh_token: "refresh_token", client_id: "client_id", client_secret: "client_secret", dev_key: "dev_key", expires_at: "expiration time")
If your access token is still valid (be careful, access tokens may only be valid for about 1 hour), you can use the client directly. If you want to refresh the access token using the refresh token just do:
@@ -407,12 +407,12 @@ def client
class OAuth2Client < YouTubeIt::Client
def initialize(options)
- @client_id = options[:client_id]
- @client_secret = options[:client_secret]
- @client_access_token = options[:client_access_token]
- @client_refresh_token = options[:client_refresh_token]
+ @client_id = options[:client_id]
+ @client_secret = options[:client_secret]
+ @client_access_token = options[:client_access_token]
+ @client_refresh_token = options[:client_refresh_token]
@client_token_expires_at = options[:client_token_expires_at]
- @dev_key = options[:dev_key]
+ @dev_key = options[:dev_key]
end
def oauth_client

0 comments on commit fadc877

Please sign in to comment.