Module: GReader
- Defined in:
- lib/greader.rb,
lib/greader/tag.rb,
lib/greader/feed.rb,
lib/greader/entry.rb,
lib/greader/client.rb,
lib/greader/entries.rb,
lib/greader/version.rb,
lib/greader/utilities.rb
Overview
Google Reader API client.
Common usage
First, log in (returns a Client or ‘nil`):
@client = GReader.auth email: '[email protected]', password: 'password'
Common Client usage
A Client has many Feeds and Tags:
@client.feeds #=> [#<Feed>, #<Feed>, ...]
@client. #=> [#<Tag>, #<Tag>, ...]
@client.feed('FEED_ID')
@client.tag('TAG_ID')
Common Feed usage
@client.feeds.each do |feed|
p feed.id
p feed.title
p feed.url
# A Feed has many entries
feed.entries.each do |entry|
p entry.title
p entry.content
end
end
Common Tag usage
A Tag also has many feeds:
# Tag
@client.tag('TAG_ID').feeds.each { |feed| }
Other
GReader.version #=> "0.0.0"
See also
Defined Under Namespace
Modules: Utilities Classes: Client, Entries, Entry, Feed, ParseError, Tag
Constant Summary collapse
- PREFIX =
File.('../greader/', __FILE__)
- Error =
Class.new(StandardError)
- VERSION =
"0.0.3"
Class Method Summary collapse
- .auth(options = {}) ⇒ Object
-
.html_processors ⇒ Object
Returns a list of HTML pre-processors.
-
.process_html(str) ⇒ Object
Processes an HTML snippet through the given HTML processors.
- .version ⇒ Object
Class Method Details
.auth(options = {}) ⇒ Object
66 67 68 69 |
# File 'lib/greader.rb', line 66 def self.auth(={}) client = GReader::Client.new client if client.logged_in? end |
.html_processors ⇒ Object
Returns a list of HTML pre-processors. HTML snippets will be passed through this.
78 79 80 |
# File 'lib/greader.rb', line 78 def self.html_processors @html_processors ||= Array.new end |
.process_html(str) ⇒ Object
Processes an HTML snippet through the given HTML processors.
84 85 86 87 88 |
# File 'lib/greader.rb', line 84 def self.process_html(str) html = str.dup html_processors.each { |proc| html = proc.call(html) } html end |
.version ⇒ Object
4 5 6 |
# File 'lib/greader/version.rb', line 4 def self.version VERSION end |