public
Description: Google Base Auth Class is a base for authenticating to google and making requests to google services.
Homepage: http://googlebase.rubyforge.org/
Clone URL: git://github.com/jnunemaker/googlebase.git
Mike Fischer (author)
Wed Jan 14 15:38:33 -0800 2009
jnunemaker (committer)
Thu Jan 29 20:27:31 -0800 2009
commit  c17b01caa306aa4cb7864602657dd5a534b6dc0b
tree    3a94c9b92c54f12c96bb141a971090b8005c3aaf
parent  b537d210cb2c73b5fa6309167e35c9409496bad2
name age message
file History.txt Wed Feb 13 22:58:28 -0800 2008 added ssl support for get and post methods [jnunemaker]
file License.txt Mon Nov 19 17:04:45 -0800 2007 initial import of googlebase gem git-svn-id: ... [jnunemaker]
file Manifest.txt Mon Nov 19 17:04:45 -0800 2007 initial import of googlebase gem git-svn-id: ... [jnunemaker]
file README.txt Wed Feb 13 23:00:55 -0800 2008 updated readme to show ssl example [jnunemaker]
file Rakefile Mon Nov 19 17:04:45 -0800 2007 initial import of googlebase gem git-svn-id: ... [jnunemaker]
directory config/ Mon Nov 19 17:04:45 -0800 2007 initial import of googlebase gem git-svn-id: ... [jnunemaker]
directory lib/ Thu Jan 29 20:27:31 -0800 2009 Added support for Google Apps hosted domains S... [Mike Fischer]
directory log/ Mon Nov 19 17:04:45 -0800 2007 initial import of googlebase gem git-svn-id: ... [jnunemaker]
directory script/ Mon Nov 19 17:04:45 -0800 2007 initial import of googlebase gem git-svn-id: ... [jnunemaker]
file setup.rb Mon Nov 19 17:04:45 -0800 2007 initial import of googlebase gem git-svn-id: ... [jnunemaker]
directory tasks/ Mon Nov 19 17:04:45 -0800 2007 initial import of googlebase gem git-svn-id: ... [jnunemaker]
directory test/ Wed Feb 13 22:58:28 -0800 2008 added ssl support for get and post methods [jnunemaker]
directory website/ Mon Nov 19 17:04:45 -0800 2007 initial import of googlebase gem git-svn-id: ... [jnunemaker]
README.txt
Google Base Class is a base for authenticating to google and making requests to google services.

=Installation

sudo gem install googlebase

=Usage

===Establish A Connection

The code below shows how to use the gem by itself. It checks if username and password are correct (raising 
Google::LoginError on FAIL) and stores the session id internally. Then you can make requests and the session id is 
automatically passed in a cookie.

  require 'google/base'
  Google::Base.establish_connection('username', 'password')
  Google::Base.get('http://google.com/reader/path/to/whatever/')
  Google::Base.get('https://google.com:443/analytics/home/') # to make an ssl request

===Inheritance

This example takes things a bit farther and shows how to use this class simply as a base to get some methods for free 
and then wrap whatever google service you would like.
  
  require 'google/base'
  Google::Base.establish_connection('username', 'password')
  module Google
    module Reader
      class Base < Google::Base
        class << self
          def get_token
            get("http://www.google.com/reader/api/0/token")
          end
        end
      end
    end
  end

  puts Google::Reader::Base.get_token