Skip to content

Instantly share code, notes, and snippets.

@sporkmonger
Created April 25, 2012 14:37
Show Gist options
  • Save sporkmonger/2490216 to your computer and use it in GitHub Desktop.
Save sporkmonger/2490216 to your computer and use it in GitHub Desktop.
gem 'signet', '~> 0.3.0'
require 'signet/oauth_2/client'
gem 'google-api-client', '~> 0.4.3'
require 'google/api_client'
require 'google/api_client/client_secrets'
client_secrets = Google::APIClient::ClientSecrets.load('client_secrets.json')
client = Google::APIClient.new(
:authorization => Signet::OAuth2::Client.new(
:client_id => client_secrets.client_id,
:client_secrets => client_secrets.client_secrets,
:redirect_uri => client_secrets.redirect_uris.first,
:authorization_uri =>
'https://accounts.google.com/o/oauth2/auth',
:token_credential_uri =>
'https://accounts.google.com/o/oauth2/token'
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment