Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jnunemaker/googlebase
[DEAD] Google Base Auth Class is a base for authenticating to google and making requests to google services.
https://github.com/jnunemaker/googlebase
Last synced: 17 days ago
JSON representation
[DEAD] Google Base Auth Class is a base for authenticating to google and making requests to google services.
- Host: GitHub
- URL: https://github.com/jnunemaker/googlebase
- Owner: jnunemaker
- License: mit
- Created: 2008-02-14T02:45:29.000Z (over 16 years ago)
- Default Branch: master
- Last Pushed: 2013-06-05T20:48:34.000Z (over 11 years ago)
- Last Synced: 2024-10-17T02:26:27.045Z (23 days ago)
- Language: Ruby
- Homepage: http://googlebase.rubyforge.org/
- Size: 284 KB
- Stars: 21
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.txt
- Changelog: History.txt
- License: License.txt
Awesome Lists containing this project
README
DEAD AND UNMAINTAINED
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
endputs Google::Reader::Base.get_token