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>
10 [](http://travis-ci.org/google/google-api-ruby-client)
11 [](https://gemnasium.com/google/google-api-ruby-client)
15 The Google API Ruby Client makes it trivial to discover and access supported
20 # Initialize the client & Google+ API
21 require 'google/api_client'
22 client = Google::APIClient.new
23 plus = client.discovered_api('plus')
25 # Initialize OAuth 2.0 client
26 client.authorization.client_id = '<CLIENT_ID_FROM_API_CONSOLE>'
27 client.authorization.client_secret = '<CLIENT_SECRET>'
28 client.authorization.scope = 'https://www.googleapis.com/auth/plus.me'
30 # Request authorization
31 redirect_uri = client.authorization.authorization_uri
33 # Wait for authorization code then exchange for token
34 client.authorization.code = '....'
35 client.authorization.fetch_access_token!
38 result = client.execute(
39 :api_method => plus.activities.list'
40 :parameters => {'collection' => 'public', 'userId' => 'me'}
47 Be sure `http://rubygems.org/` is in your gem sources.
49 For normal client usage, this is sufficient:
51 $ sudo gem install google-api-client
53 The command line interface, the example applications, and the test suite
54 require additional dependencies. These may be obtained with:
56 $ sudo gem install google-api-client --development --force --no-rdoc --no-ri