Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gdata_plus

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gdata_plus

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= 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

Package last updated on 03 Jan 2011

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc