3 Homepage:: google-api-ruby-client[http://code.google.com/p/google-api-ruby-client/]
4 Authors:: Bob Aman (mailto:bobaman@google.com), Matt Pokrzywa (mailto:mattpok@google.com)
5 Copyright:: Copyright 2010 Google Inc.
10 The Google API Ruby Client makes it trivial to discover and access supported
15 # Initialize the client
16 require 'google/api_client'
17 require 'signet/oauth_1/client'
18 client = Google::APIClient.new(
20 # Buzz has API-specific endpoints
21 :authorization => Signet::OAuth1::Client.new(
22 :temporary_credential_uri =>
23 'https://www.google.com/accounts/OAuthGetRequestToken',
25 'https://www.google.com/buzz/api/auth/OAuthAuthorizeToken',
26 :token_credential_uri =>
27 'https://www.google.com/accounts/OAuthGetAccessToken',
28 :client_credential_key => 'anonymous',
29 :client_credential_secret => 'anonymous'
32 client.authorization.fetch_temporary_credential!(
33 :additional_parameters => {
34 'scope' => 'https://www.googleapis.com/auth/buzz'
37 redirect_uri = client.authorization.authorization_uri(
38 :additional_parameters => {
39 'domain' => client.authorization.client_credential_key,
40 'scope' => 'https://www.googleapis.com/auth/buzz'
44 client.authorization.fetch_token_credential!(:verifier => '12345')
46 # Discover available methods
47 method_names = client.discovered_service('buzz').to_h.keys
50 response = client.execute(
51 'chili.activities.list',
52 {'scope' => '@self', 'userId' => '@me', 'alt' => 'json'}
54 status, headers, body = response
58 * APIClient has no dependencies.
62 * sudo gem install google-api-client