Module: Theoldreader
- Defined in:
- lib/theoldreader.rb,
lib/theoldreader/base.rb,
lib/theoldreader/config.rb,
lib/theoldreader/errors.rb,
lib/theoldreader/version.rb,
lib/theoldreader/api/service.rb,
lib/theoldreader/api/response.rb
Defined Under Namespace
Modules: API
Classes: APIError, Base, ClientError, Config, ServerError, TheoldreaderError
Constant Summary
collapse
- VERSION =
"0.0.3"
Class Method Summary
collapse
Class Method Details
.add_subscription(subscription) ⇒ Object
75
76
77
|
# File 'lib/theoldreader.rb', line 75
def self.add_subscription(subscription)
Theoldreader::Base.post({quickadd: subscription}, endpoint: 'subscription/quickadd')
end
|
.atom_feed(path) ⇒ Object
113
114
115
|
# File 'lib/theoldreader.rb', line 113
def self.atom_feed(path)
Theoldreader::API::Service.instance.make_request(:get, path, {}, Theoldreader::Base., {base_path: '/reader/atom'}).body
end
|
.delete_subscription(subscription_id) ⇒ Object
84
85
86
|
# File 'lib/theoldreader.rb', line 84
def self.delete_subscription(subscription_id)
Theoldreader::Base.post({ac: 'unsubscribe', s: subscription_id}, endpoint: 'subscription/edit')
end
|
.delete_tag(tag_name) ⇒ Object
59
60
61
|
# File 'lib/theoldreader.rb', line 59
def self.delete_tag(tag_name)
Theoldreader::Base.post({s: tag_name}, endpoint: 'disable-tag')
end
|
.fetch_token(email, password, app_name) ⇒ Object
17
18
19
20
21
|
# File 'lib/theoldreader.rb', line 17
def self.fetch_token(email, password, app_name)
Theoldreader::API::Service.instance.make_request(:post, '', {client: app_name,
accountType: 'HOSTED_OR_GOOGLE', service: 'reader', Email: email, Passwd: password}, {},
{base_path: '/accounts/ClientLogin'}).body
end
|
.friends ⇒ Object
39
40
41
|
# File 'lib/theoldreader.rb', line 39
def self.friends
Theoldreader::Base.get({}, endpoint: 'friend/list')
end
|
.item_ids(params = {}) ⇒ Object
88
89
90
91
|
# File 'lib/theoldreader.rb', line 88
def self.item_ids(params = {})
filtered_params = filter_params(%w{s xt n r c nt ot}, params)
Theoldreader::Base.get(filtered_params, endpoint: 'stream/items/ids')
end
|
.items(params = {}) ⇒ Object
93
94
95
96
|
# File 'lib/theoldreader.rb', line 93
def self.items(params = {})
filtered_params = filter_params(%w{i output}, params)
Theoldreader::Base.post(filtered_params, endpoint: 'stream/items/contents')
end
|
.mark_all_as_read(params = {}) ⇒ Object
103
104
105
106
|
# File 'lib/theoldreader.rb', line 103
def self.mark_all_as_read(params = {})
filtered_params = filter_params(%w{s ts}, params)
Theoldreader::Base.post(filtered_params, endpoint: 'mark-all-as-read')
end
|
.preference ⇒ Object
35
36
37
|
# File 'lib/theoldreader.rb', line 35
def self.preference
Theoldreader::Base.get({}, endpoint: 'preference/list')
end
|
.rename_tag(src, dest) ⇒ Object
55
56
57
|
# File 'lib/theoldreader.rb', line 55
def self.rename_tag(src, dest)
Theoldreader::Base.post({s: src, dest: dest}, endpoint: 'rename-tag')
end
|
.set_token(token) ⇒ Object
13
14
15
|
# File 'lib/theoldreader.rb', line 13
def self.set_token(token)
Theoldreader::Config.token = token
end
|
.status ⇒ Object
23
24
25
|
# File 'lib/theoldreader.rb', line 23
def self.status
Theoldreader::Base.get({}, endpoint: 'status')
end
|
.stream(params = {}) ⇒ Object
98
99
100
101
|
# File 'lib/theoldreader.rb', line 98
def self.stream(params = {})
filtered_params = filter_params(%w{i output}, params)
Theoldreader::Base.get(filtered_params, endpoint: 'stream/contents')
end
|
.stream_preference ⇒ Object
47
48
49
|
# File 'lib/theoldreader.rb', line 47
def self.stream_preference
Theoldreader::Base.get({}, endpoint: 'preference/stream/list')
end
|
.subscription_opml ⇒ Object
71
72
73
|
# File 'lib/theoldreader.rb', line 71
def self.subscription_opml
Theoldreader::API::Service.instance.make_request(:get, 'subscriptions/export', {}, Theoldreader::Base., {base_path: '/reader'}).body
end
|
.subscriptions ⇒ Object
67
68
69
|
# File 'lib/theoldreader.rb', line 67
def self.subscriptions
Theoldreader::Base.get({}, endpoint: 'subscription/list')
end
|
43
44
45
|
# File 'lib/theoldreader.rb', line 43
def self.tags
Theoldreader::Base.get({}, endpoint: 'tag/list')
end
|
.token ⇒ Object
27
28
29
|
# File 'lib/theoldreader.rb', line 27
def self.token
Theoldreader::Base.get({}, endpoint: 'token')
end
|
.unread_count ⇒ Object
63
64
65
|
# File 'lib/theoldreader.rb', line 63
def self.unread_count
Theoldreader::Base.get({}, endpoint: 'unread-count')
end
|
.update_items(params = {}) ⇒ Object
108
109
110
111
|
# File 'lib/theoldreader.rb', line 108
def self.update_items(params = {})
filtered_params = filter_params(%w{i output}, params)
Theoldreader::Base.post(filtered_params, endpoint: 'edit-tag')
end
|
.update_stream_preference(params) ⇒ Object
51
52
53
|
# File 'lib/theoldreader.rb', line 51
def self.update_stream_preference(params)
Theoldreader::Base.post({}, endpoint: 'preference/stream/set')
end
|
.update_subscription(subscription_id, params = {}) ⇒ Object
79
80
81
82
|
# File 'lib/theoldreader.rb', line 79
def self.update_subscription(subscription_id, params = {})
filtered_params = filter_params(%w{t a r}, params)
Theoldreader::Base.post(filtered_params.merge({ac: 'edit', s: subscription_id}), endpoint: 'subscription/edit')
end
|
.user_info ⇒ Object
31
32
33
|
# File 'lib/theoldreader.rb', line 31
def self.user_info
Theoldreader::Base.get({}, endpoint: 'user-info')
end
|