Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
= gdata_plus
{Source code}[https://github.com/balexand/gdata_plus] | {RDoc}[http://rubydoc.info/gems/gdata_plus/frames] | {Ruby Gem}[https://rubygems.org/gems/gdata_plus]
Simple, easy to use GData API that supports OAuth, Ruby 1.8/1.9 and uses Typhoeus as an HTTP 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}[http://nokogiri.org/tutorials/searching_a_xml_html_document.html] 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}[https://github.com/pauldix/typhoeus] request and submit it to the client.
request = Typhoeus::Request.new(...) client.submit request
== Authentication
{OAuth}[http://code.google.com/apis/gdata/docs/auth/oauth.html] and {ClientLogin}[http://code.google.com/apis/gdata/docs/auth/clientlogin.html] 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}[http://code.google.com/apis/accounts/docs/RegistrationForWebAppsAuto.html] and get a consumer key and consumer secret from Google. See {the OAuth example}[https://github.com/balexand/gdata_plus/blob/master/examples/oauth_example.rb] 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}[https://github.com/balexand/gdata_plus/blob/master/examples/client_login_example.rb].
=== 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}[https://github.com/balexand/gdata_plus/issues/1] 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 (c) 2010 Brian Alexander. See LICENSE.txt for further details.
FAQs
Unknown package
We found that gdata_plus demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.