-
-
Save MichaelEvans/5264233 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ----------------- OAUTH CONSUMER ------------------ | |
consumer = OAuth::Consumer.new('anonymous', 'anonymous', { | |
:site => 'https://www.google.com', | |
:request_token_path => '/accounts/OAuthGetRequestToken', | |
:access_token_path => '/accounts/OAuthGetAccessToken', | |
:authorize_path => '/accounts/OAuthAuthorizeToken' | |
}) | |
# ----------------- NEW OAUTH TOKEN ------------------ | |
request_token = consumer.get_request_token({}, {:scope => 'https://www.google.com/analytics/feeds'}) | |
puts request_token.authorize_url # gives us the verifier, enter it in a url | |
# access_token = request_token.get_access_token(:oauth_verifier => '') # paste in the info from google | |
# pull out the secret and token from the above access token, and save in strings for later | |
# ----------------- OAUTH INFO FOR xxx ------------------ | |
# secret = '' | |
# token = '' | |
# access_token = OAuth::AccessToken.new(consumer, token, secret) | |
Garb::Session.access_token = access_token # apply the access_token | |
# session.access_token = access_token # or apply to an individual session |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment