Go to file
Steven Bazyl 9bd9ceb75c More documentation cleanup 2012-10-10 14:28:45 -06:00
bin Remove embedded version #s, use Gemfile 2012-10-10 14:24:25 -06:00
lib More documentation cleanup 2012-10-10 14:28:45 -06:00
spec Mostly doc updates, +remove support for method as string 2012-10-10 14:28:45 -06:00
tasks Updating version and dependencies. 2012-07-31 16:56:17 +03:00
yard Added super-hacky script to generate the wiki reference pages. 2011-12-02 17:24:56 +03:00
.gitignore Ignore .rvmrc file 2012-06-14 10:48:29 +02:00
.rspec Upgrade RSpec 1.x to RSpec 2.10-x 2012-06-14 11:18:35 +02:00
.travis.yml Adding Steven to the Travis notification list. 2012-05-11 13:53:17 +03:00
.yardopts Add .yardopts for doc hosting 2012-07-19 14:14:03 -07:00
CHANGELOG.md Continue internal shuffling... 2012-10-10 14:28:45 -06:00
Gemfile Remove embedded version #s, use Gemfile 2012-10-10 14:24:25 -06:00
LICENSE Basic project skeleton. 2010-07-28 19:30:56 +00:00
README.md Update example in readme 2012-10-10 14:25:43 -06:00
Rakefile Updating dependencies. 2012-07-21 13:51:23 +03:00
google-api-client.gemspec Added the ability to create an authorization object from client secrets. 2012-10-05 12:07:42 +03:00

README.md

APIClient

Homepage
http://code.google.com/p/google-api-ruby-client
Author
Bob Aman
Copyright
Copyright © 2011 Google, Inc.
License
Apache 2.0

Build Status Dependency Status

Description

The Google API Ruby Client makes it trivial to discover and access supported APIs.

Example Usage

# Initialize the client & Google+ API
require 'google/api_client'
client = Google::APIClient.new
plus = client.discovered_api('plus')

# Initialize OAuth 2.0 client    
client.authorization.client_id = '<CLIENT_ID_FROM_API_CONSOLE>'
client.authorization.client_secret = '<CLIENT_SECRET>'
client.authorization.scope = 'https://www.googleapis.com/auth/plus.me'

# Request authorization
redirect_uri = client.authorization.authorization_uri

# Wait for authorization code then exchange for token
client.authorization.code = '....'
client.authorization.fetch_access_token!

# Make an API call
result = client.execute(
  :api_method => plus.activities.list'
  :parameters => {'collection' => 'public', 'userId' => 'me'}
)

puts result.data

Install

Be sure http://rubygems.org/ is in your gem sources.

For normal client usage, this is sufficient:

$ sudo gem install google-api-client

The command line interface, the example applications, and the test suite require additional dependencies. These may be obtained with:

$ sudo gem install google-api-client --development --force --no-rdoc --no-ri