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/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__)
- VERSION =
"0.0.2"
- Error =
Class.new(StandardError)
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
65 66 67 68 |
# File 'lib/greader.rb', line 65 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.
77 78 79 |
# File 'lib/greader.rb', line 77 def self.html_processors @html_processors ||= Array.new end |
.process_html(str) ⇒ Object
Processes an HTML snippet through the given HTML processors.
83 84 85 86 87 |
# File 'lib/greader.rb', line 83 def self.process_html(str) html = str.dup html_processors.each { |proc| html = proc.call(html) } html end |
.version ⇒ Object
89 90 91 |
# File 'lib/greader.rb', line 89 def self.version VERSION end |