Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

[no longer maintained] Discontinued because there's an official gem: google-api-client

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 examples
Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .document
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 LICENSE.txt
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 VERSION
Octocat-spinner-32 gdata_plus.gemspec
README.rdoc

gdata_plus

No longer maintained

Google now has an official GData Ruby gem: google-api-client

Installation

gem install gdata_plus

Making requests

Start by getting the client from the authenticator (see Authentication below).

client = authenticator.client

Then make a request.

response = client.get("https://picasaweb.google.com/data/feed/api/user/default")

Then parse the response using your preferred XML library. I'll use Nokogiri for this example.

feed = Nokogiri::XML(response.body)
album_titles = feed.xpath("//xmlns:entry/xmlns:title/text()").collect {|i| "#{i}"}

If you need more control over the request, then you can create your own Typhoeus request and submit it to the client.

request = Typhoeus::Request.new(...)
client.submit request

Authentication

OAuth and ClientLogin are supported. OAuth is preferred for web apps and ClientLogin is convenient for installed apps and command-line utilities.

OAuth

Before using OAuth, you will need to register your domain and get a consumer key and consumer secret from Google. See the OAuth example for getting started with OAuth.

Using an existing access token

If you already have an access token and access token secret, then you can construct an OAuth authenticator as follows:

GDataPlus::Authenticator::OAuth.new(
  :consumer_key => CONSUMER_KEY,
  :consumer_secret => CONSUMER_SECRET,
  :access_token => access_token,
  :access_secret => access_secret
)

ClientLogin

See the ClientLogin example.

Serializing authenticators

Both the OAuth and ClientLogin authenticators can be serialized using a method like to_yaml.

Error handling

TODO

Ruby support

This project is tested against Ruby 1.8.7 and Ruby 1.9.2. There is an issue with international characters and OAuth that affects Ruby 1.8.7.

Contributions

This project is actively maintained. Please submit an issue if you find any bugs or want to request a new feature. Contributions are welcome. Please run the tests with Ruby 1.9.2 and 1.8.7 before submitting a pull request:

rake test

Copyright

Copyright © 2010 Brian Alexander. See LICENSE.txt for further details.

Something went wrong with that request. Please try again.