Class: Google::Reader::Base
- Inherits:
-
Base
- Object
- Base
- Google::Reader::Base
show all
- Defined in:
- lib/google/reader/base.rb
Class Method Summary
collapse
Class Method Details
.get_entries(url, o = {}) ⇒ Object
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/google/reader/base.rb', line 13
def get_entries(url, o={})
options = {:continuation => true,}.merge(o)
body = get(url)
if options[:continuation]
entries = parse(body).entries
entries.class.class_eval "attr_accessor :continuation"
entries.continuation = (body)
entries
else
parse(body).entries
end
end
|
.get_token ⇒ Object
Gets a new token which can be used with all non-get requests.
27
28
29
|
# File 'lib/google/reader/base.rb', line 27
def get_token
get(TOKEN_URL)
end
|
.parse(atom_feed) ⇒ Object
5
6
7
|
# File 'lib/google/reader/base.rb', line 5
def parse(atom_feed)
Atom::Feed.new(atom_feed)
end
|
.parse_json(json_str) ⇒ Object
9
10
11
|
# File 'lib/google/reader/base.rb', line 9
def parse_json(json_str)
JSON.parse(json_str)
end
|
.user_info ⇒ Object
Last time I checked this returns a hash like:
{"isBloggerUser": true, "userId": "<user id number>", "userEmail": "[email protected]"}
33
34
35
|
# File 'lib/google/reader/base.rb', line 33
def user_info
parse_json(get(USER_INFO_URL))
end
|