Class: Google::Reader::Stream

Inherits:
Base
  • Object
show all
Defined in:
lib/google/reader/stream.rb

Class Method Summary collapse

Methods inherited from Base

get_entries, get_token, normalize_feed_url, parse, parse_json, user_info

Class Method Details

.fetch(feed_url, options = {}) ⇒ Object

Params: xt - exclude target, e.g. xt=user/-/state/com.google/read r - order (n - newest first, o - oldest first) ot - if r=o, only items posted after ot are returned (unix timestamp) ck - current timestamp? c - continuation n - count client - ?



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/google/reader/stream.rb', line 12

def self.fetch(feed_url, options = {})
  url = sprintf(STREAM_URL, feed_url)
  options = {
    :query_hash => {
      :ck => Time.now.to_i,
      :n  => 20
    }
  }.deep_merge(options)
  json = get(url, options)
  data = parse_json(json)
end

.fetch_feed(feed_url, options = {}) ⇒ Object



24
25
26
27
# File 'lib/google/reader/stream.rb', line 24

def self.fetch_feed(feed_url, options = {})
  feed_url = 'feed/' + CGI.escape(normalize_feed_url(feed_url))
  fetch feed_url, options
end