Skip to content

Instantly share code, notes, and snippets.

@grigio
Created March 18, 2010 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grigio/336604 to your computer and use it in GitHub Desktop.
Save grigio/336604 to your computer and use it in GitHub Desktop.
# Usage: ruby google-oauth-example.rb
require "rubygems"
require "oauth"
require "json"
CONSUMER_KEY = 'anonymous'
CONSUMER_SECRET = 'anonymous'
ACCESS_TOKEN = ''
ACCESS_TOKEN_SECRET = '' # Get them from Google Playground
consumer = OAuth::Consumer.new(
CONSUMER_KEY,
CONSUMER_SECRET,
:site => "http://gdata.youtube.com"
)
@access_token = OAuth::AccessToken.new(consumer, ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
puts @access_token.get('/feeds/api/users/default').body
# console
require 'irb'
IRB.start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment