Go to file
Bob Aman 0903702738 Apparently the ||= operator does not work with constants in some versions of Ruby. 2012-10-10 19:59:55 +03:00
bin Updating dependencies. 2012-07-21 13:51:23 +03:00
lib This should resolve the issue with Kernel#load. 2012-10-08 17:06:08 +03:00
spec Apparently the ||= operator does not work with constants in some versions of Ruby. 2012-10-10 19:59:55 +03: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 Added the ability to create an authorization object from client secrets. 2012-10-05 12:07:42 +03:00
Gemfile This should "resolve" issues with OS X. 2012-10-08 17:07:08 +03:00
LICENSE Basic project skeleton. 2010-07-28 19:30:56 +00:00
README.md Added build status to README. 2012-05-11 13:16:38 +03: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
require 'google/api_client'
require 'signet/oauth_1/client'
client = Google::APIClient.new(
  :service => 'buzz',
  # Buzz has API-specific endpoints
  :authorization => Signet::OAuth1::Client.new(
    :temporary_credential_uri =>
      'https://www.google.com/accounts/OAuthGetRequestToken',
    :authorization_uri =>
      'https://www.google.com/buzz/api/auth/OAuthAuthorizeToken',
    :token_credential_uri =>
      'https://www.google.com/accounts/OAuthGetAccessToken',
    :client_credential_key => 'anonymous',
    :client_credential_secret => 'anonymous'
  )
)
client.authorization.fetch_temporary_credential!(
  :additional_parameters => {
    'scope' => 'https://www.googleapis.com/auth/buzz'
  }
)
redirect_uri = client.authorization.authorization_uri(
  :additional_parameters => {
    'domain' => client.authorization.client_credential_key,
    'scope' => 'https://www.googleapis.com/auth/buzz'
  }
)
# Redirect user here
client.authorization.fetch_token_credential!(:verifier => '12345')

# Discover available methods
method_names = client.discovered_api('plus').to_h.keys

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

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