Skip to content

Instantly share code, notes, and snippets.

@basicxman
Created October 24, 2011 20:43
Show Gist options
  • Select an option

  • Save basicxman/1310184 to your computer and use it in GitHub Desktop.

Select an option

Save basicxman/1310184 to your computer and use it in GitHub Desktop.
require "pp"
require "oauth"
key = "secret"
secret = "secret"
consumer = OAuth::Consumer.new(key, secret, {
:site => "http://www.google.com",
:request_token_path => "/accounts/OAuthGetRequestToken",
:access_token_path => "/accounts/OAuthGetAccessToken",
:authorize_path => "/accounts/OAuthAuthorizeToken"
})
access_token = OAuth::AccessToken.new(consumer)
version = "2.0"
url = "https://www.google.com/calendar/feeds/default/private/full?xoauth_requestor_id=SECRET_EMAIL"
response = access_token.request(:get, url, { 'GData-Version' => version })
pp response
#<Net::HTTPUnauthorized 401 Token invalid - Invalid AuthSub token. readbody=true>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment