4 <dt>Homepage</dt><dd><a href="http://code.google.com/p/google-api-ruby-client">http://code.google.com/p/google-api-ruby-client</a></dd>
5 <dt>Author</dt><dd><a href="mailto:bobaman@google.com">Bob Aman</a></dd>
6 <dt>Copyright</dt><dd>Copyright © 2011 Google, Inc.</dd>
7 <dt>License</dt><dd>Apache 2.0</dd>
12 The Google API Ruby Client makes it trivial to discover and access supported
17 # Initialize the client
18 require 'google/api_client'
19 require 'signet/oauth_1/client'
20 client = Google::APIClient.new(
22 # Buzz has API-specific endpoints
23 :authorization => Signet::OAuth1::Client.new(
24 :temporary_credential_uri =>
25 'https://www.google.com/accounts/OAuthGetRequestToken',
27 'https://www.google.com/buzz/api/auth/OAuthAuthorizeToken',
28 :token_credential_uri =>
29 'https://www.google.com/accounts/OAuthGetAccessToken',
30 :client_credential_key => 'anonymous',
31 :client_credential_secret => 'anonymous'
34 client.authorization.fetch_temporary_credential!(
35 :additional_parameters => {
36 'scope' => 'https://www.googleapis.com/auth/buzz'
39 redirect_uri = client.authorization.authorization_uri(
40 :additional_parameters => {
41 'domain' => client.authorization.client_credential_key,
42 'scope' => 'https://www.googleapis.com/auth/buzz'
46 client.authorization.fetch_token_credential!(:verifier => '12345')
48 # Discover available methods
49 method_names = client.discovered_api('buzz').to_h.keys
52 response = client.execute(
53 'chili.activities.list',
54 {'scope' => '@self', 'userId' => '@me', 'alt' => 'json'}
56 status, headers, body = response
60 Be sure `http://rubygems.org/` is in your gem sources.
62 For normal client usage, this is sufficient:
64 $ sudo gem install google-api-client
66 The command line interface, the example applications, and the test suite
67 require additional dependencies. These may be obtained with:
69 $ sudo gem install google-api-client --development --force --no-rdoc --no-ri