bleacher_api 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +113 -2
- data/config/gemspec.yml +1 -1
- data/lib/bleacher_api.rb +9 -1
- data/spec/bleacher_api_spec.rb +18 -1
- metadata +56 -71
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 72fac7fe1fa85dd960436f1fa3962c138f71915e
|
4
|
+
data.tar.gz: 5b26b5e8d88427b8c4702795fabc0e988ef65612
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0aa91a68dc269e6f5d460ad8d72971a3adb1760039eaee8b327562d83ad26f8ffdb686ad6ba7afdb2908e3861008272a8e23b9c7e8cd79c6223fbd1dc3705252
|
7
|
+
data.tar.gz: 31df598505f70ff2299187b1da9d0f634b863f0c31aef187d1f4f93139621f3505bd36bddba17a99145d450d0682e1c4f948f115b2d44f80f24516bcf49f1190
|
data/README.md
CHANGED
@@ -18,7 +18,9 @@ Table of Contents
|
|
18
18
|
* [POST /api/authenticate/login.json](#authenticate_login_post)
|
19
19
|
* [GET /api/authenticate/logout.json](#authenticate_logout)
|
20
20
|
* [GET /api/authenticate/signup](#authenticate_signup)
|
21
|
+
* [POST /api/authenticate/forgot_password](#authenticate_forgot_password)
|
21
22
|
* [GET /api/front/lead_articles.json](#front_lead_articles)
|
23
|
+
* [GET /api/front/v2/lead_articles.json](#front_lead_articles_v2)
|
22
24
|
* [GET /api/geolocation/teams.json](#geolocation_teams)
|
23
25
|
* [GET /api/related/channel.json](#related_channel)
|
24
26
|
* [GET /api/related/channel_next.json](#related_channel_next)
|
@@ -37,6 +39,7 @@ GET /api/article/article.json
|
|
37
39
|
* article[entry_id] - Changes article body to a quick hit or live blog entry
|
38
40
|
* article[only] - When given comma-separated parameters, returns only values for the parameters in JSON output
|
39
41
|
* comments[page] - When given a page number, action includes comments in JSON output
|
42
|
+
* comments[order] = When given an order (in sql syntax), action includes comments in JSON output sorted by order
|
40
43
|
* related_content - When given any value, action includes related content in JSON output
|
41
44
|
|
42
45
|
### Returns
|
@@ -161,6 +164,36 @@ http://bleacherreport.com/api/authenticate/signup?redirect_url=http://bleacherre
|
|
161
164
|
A `redirect_url` parameter is mandatory. B/R will redirect the request back to that URL, passing basic information
|
162
165
|
from the <a href="#user_user">User API</a> as GET parameters.
|
163
166
|
|
167
|
+
<a name="authenticate_forgot_password"></a>
|
168
|
+
|
169
|
+
POST /api/authenticate/forgot_password
|
170
|
+
----------------------------
|
171
|
+
|
172
|
+
### Parameters
|
173
|
+
|
174
|
+
* email
|
175
|
+
* redirect_url (optional)
|
176
|
+
* format (optional) - json or not
|
177
|
+
|
178
|
+
### Returns
|
179
|
+
|
180
|
+
Either json of success/error, html status of 200 or 404 (for ajax), or redirect.
|
181
|
+
|
182
|
+
### HTTP Example
|
183
|
+
|
184
|
+
<pre>
|
185
|
+
http://bleacherreport.com/api/authenticate/forgot_password.json?email=bherman@bleacherreport.com
|
186
|
+
</pre>
|
187
|
+
|
188
|
+
### Paramter Info
|
189
|
+
|
190
|
+
Email parameter is mandatory.
|
191
|
+
|
192
|
+
If requesting json, redirect_url will be ignored. If non-json and redirect_url, the request will be treated as html and redirect to the specified url.
|
193
|
+
If no params, it will be treated as an html request, but only return a status code of 200 for success or 404 for error (which could be an inability to find the email or any other error).
|
194
|
+
|
195
|
+
On success, a forgot password email will be triggered.
|
196
|
+
|
164
197
|
<a name="front_lead_articles"></a>
|
165
198
|
|
166
199
|
GET /api/front/lead_articles.json
|
@@ -168,14 +201,24 @@ GET /api/front/lead_articles.json
|
|
168
201
|
|
169
202
|
### Parameters
|
170
203
|
|
171
|
-
*
|
204
|
+
* tags - Optional; comma separated list of team permalinks
|
205
|
+
* devicetype - Optional; currently supports 'ipad'
|
206
|
+
* appversion - Optional;
|
207
|
+
* page - Optional
|
208
|
+
* perpage - Optional
|
209
|
+
* limit - Optional; deprecated - use perpage
|
172
210
|
|
173
211
|
### Returns
|
174
212
|
|
175
|
-
An array of article objects with the following keys: permalink, primary\_image\_650x440,
|
213
|
+
An array of article objects with the following keys: permalink, primary\_image\_650x440,
|
214
|
+
primary\_image\_311x210, title and tag (the tag of the teamstream from which the article came).
|
176
215
|
|
177
216
|
The array of articles represents the articles currently on the lead module of the front page.
|
178
217
|
|
218
|
+
For appversion >= '1.4' and devicetype = 'ipad', specifying one or more tags will
|
219
|
+
return an array of articles, with the articles currently on the lead module of the front
|
220
|
+
page merged with articles from the team streams of the specified teams.
|
221
|
+
|
179
222
|
### Ruby Example
|
180
223
|
|
181
224
|
<pre>
|
@@ -186,10 +229,78 @@ BleacherApi::Front.lead_articles(:limit => 2)
|
|
186
229
|
|
187
230
|
<pre>
|
188
231
|
http://bleacherreport.com/api/front/lead_articles.json?limit=2
|
232
|
+
http://bleacherreport.com/api/front/lead_articles.json?tags=san-francisco-49ers,oakland-raiders&devicetype=ipad&appversion=1.4&page=1&perpage=10
|
189
233
|
</pre>
|
190
234
|
|
191
235
|
<a name="geolocation_teams"></a>
|
192
236
|
|
237
|
+
<a name="front_lead_articles_v2"></a>
|
238
|
+
GET /api/front/v2/lead_articles.json
|
239
|
+
------------------------------------
|
240
|
+
|
241
|
+
### Parameters
|
242
|
+
* tags - Optional; comma separated list of team permalinks
|
243
|
+
* devicetype - Optional; currently supports 'ipad'
|
244
|
+
* appversion - Optional
|
245
|
+
* page - Optional
|
246
|
+
* perpage - Optional; default 5
|
247
|
+
|
248
|
+
### Returns
|
249
|
+
|
250
|
+
An object containing: 1) a variable with the maximun number of articles available for the query, disregarding
|
251
|
+
the perpage parameter, and 2) an array of article objects with the following keys: permalink, primary\_image\_650x440,
|
252
|
+
primary\_image\_311x210, title and tag (the tag of the teamstream from which the article came).
|
253
|
+
|
254
|
+
The array of articles represents the articles currently on the lead module of the front page.
|
255
|
+
|
256
|
+
For devicetype = 'ipad', specifying one or more tags will
|
257
|
+
return an array of articles, with the articles currently on the lead module of the front
|
258
|
+
page merged with articles from the team streams of the specified teams.
|
259
|
+
|
260
|
+
<pre>
|
261
|
+
{
|
262
|
+
all_articles: 53,
|
263
|
+
articles:
|
264
|
+
[
|
265
|
+
{
|
266
|
+
permalink: "979252-nba-rumors-roundup-chris-paul-to-clippers-latest-on-dwight-howard-and-more",
|
267
|
+
primary_image_311x210: "http://img.bleacherreport.net/img/images/photos/001/484/347/326afbbaae76d91b000f6a706700345b_0_original_crop_exact.jpg?w=311&h=210&q=85",
|
268
|
+
title: "NBA Trade Rumor Roundup ",
|
269
|
+
primary_image_650x440: "http://img.bleacherreport.net/img/images/photos/001/484/347/326afbbaae76d91b000f6a706700345b_0_original_crop_exact.jpg?w=650&h=440&q=85"
|
270
|
+
},
|
271
|
+
{
|
272
|
+
primary_image_650x440: "http://img.bleacherreport.net/img/images/photos/001/484/172/135247305_crop_exact.jpg?w=650&h=440&q=85",
|
273
|
+
title: "Crabtree and Edwards Steam after Loss",
|
274
|
+
tag: "san-francisco-49ers",
|
275
|
+
permalink: "http://www.csnbayarea.com/blog/niners-talk/post/49ers-frustration-evident-after-loss-to-?blockID=610322",
|
276
|
+
primary_image_311x210: "http://img.bleacherreport.net/img/images/photos/001/484/172/135247305_crop_exact.jpg?w=311&h=210&q=85"
|
277
|
+
},
|
278
|
+
{
|
279
|
+
primary_image_650x440: "http://img.bleacherreport.net/img/images/photos/001/483/828/135507905_crop_exact.jpg?w=650&h=440&q=85",
|
280
|
+
title: "Ask the Experts: Is Carson Palmer the Long-Term Answer for the Raiders?",
|
281
|
+
tag: "oakland-raiders",
|
282
|
+
permalink: "979066-ask-the-experts-is-carson-palmer-the-long-term-answer-for-the-raiders",
|
283
|
+
primary_image_311x210: "http://img.bleacherreport.net/img/images/photos/001/483/828/135507905_crop_exact.jpg?w=311&h=210&q=85"
|
284
|
+
},
|
285
|
+
...
|
286
|
+
]
|
287
|
+
}
|
288
|
+
</pre>
|
289
|
+
|
290
|
+
### Ruby Example
|
291
|
+
|
292
|
+
<pre>
|
293
|
+
BleacherApi::Front.lead_articles(:limit => 2)
|
294
|
+
</pre>
|
295
|
+
|
296
|
+
### HTTP Example
|
297
|
+
|
298
|
+
<pre>
|
299
|
+
http://bleacherreport.com/api/front/v2/lead_articles.json?limit=2
|
300
|
+
http://bleacherreport.com/api/front/v2/lead_articles.json?tags=san-francisco-49ers,oakland-raiders&devicetype=ipad&appversion=1.4&page=1&perpage=10
|
301
|
+
</pre>
|
302
|
+
|
303
|
+
<a name="geolocation_teams"></a>
|
193
304
|
GET /api/geolocation/teams.json
|
194
305
|
-------------------------------
|
195
306
|
|
data/config/gemspec.yml
CHANGED
data/lib/bleacher_api.rb
CHANGED
@@ -25,6 +25,14 @@ class BleacherApi
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
+
class Article
|
29
|
+
class <<self
|
30
|
+
def article(id, options={})
|
31
|
+
BleacherApi.call(:get, 'article/article', options.merge(:id => id))
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
28
36
|
class Authenticate
|
29
37
|
class <<self
|
30
38
|
def login(email, password, redirect=nil)
|
@@ -92,4 +100,4 @@ class BleacherApi
|
|
92
100
|
end
|
93
101
|
end
|
94
102
|
end
|
95
|
-
end
|
103
|
+
end
|
data/spec/bleacher_api_spec.rb
CHANGED
@@ -5,6 +5,23 @@ describe BleacherApi do
|
|
5
5
|
before(:all) do
|
6
6
|
@user_keys = %w(id email first_name last_name permalink token api)
|
7
7
|
end
|
8
|
+
|
9
|
+
if only?(:Article)
|
10
|
+
describe :Article do
|
11
|
+
describe :article do
|
12
|
+
|
13
|
+
describe 'success' do
|
14
|
+
before(:all) do
|
15
|
+
@response = BleacherApi::Article.article(1020834, :article => true)
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should return a hash with valid keys" do
|
19
|
+
@response.keys.should == ["article"]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
8
25
|
|
9
26
|
if only?(:Authenticate)
|
10
27
|
describe :Authenticate do
|
@@ -136,4 +153,4 @@ describe BleacherApi do
|
|
136
153
|
end
|
137
154
|
end
|
138
155
|
end
|
139
|
-
end
|
156
|
+
end
|
metadata
CHANGED
@@ -1,72 +1,64 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: bleacher_api
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
segments:
|
6
|
-
- 0
|
7
|
-
- 1
|
8
|
-
- 2
|
9
|
-
version: 0.1.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.3
|
10
5
|
platform: ruby
|
11
|
-
authors:
|
6
|
+
authors:
|
12
7
|
- Bleacher Report
|
13
8
|
autorequire:
|
14
9
|
bindir: bin
|
15
10
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2014-09-11 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
21
14
|
name: httparty
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
segments:
|
28
|
-
- 0
|
29
|
-
- 5
|
30
|
-
- 2
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '='
|
18
|
+
- !ruby/object:Gem::Version
|
31
19
|
version: 0.5.2
|
32
20
|
type: :runtime
|
33
|
-
version_requirements: *id001
|
34
|
-
- !ruby/object:Gem::Dependency
|
35
|
-
name: rake
|
36
21
|
prerelease: false
|
37
|
-
|
38
|
-
requirements:
|
39
|
-
- -
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.5.2
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
45
33
|
version: 0.8.7
|
46
34
|
type: :development
|
47
|
-
version_requirements: *id002
|
48
|
-
- !ruby/object:Gem::Dependency
|
49
|
-
name: rspec
|
50
35
|
prerelease: false
|
51
|
-
|
52
|
-
requirements:
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.8.7
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
53
45
|
- - ~>
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
|
56
|
-
- 1
|
57
|
-
- 0
|
58
|
-
version: "1.0"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.0'
|
59
48
|
type: :development
|
60
|
-
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.0'
|
61
55
|
description: A Ruby Interface to the Bleacher Report API
|
62
56
|
email: wwelsh@bleacherreport.com
|
63
|
-
executables:
|
57
|
+
executables:
|
64
58
|
- bleacher_api
|
65
59
|
extensions: []
|
66
|
-
|
67
60
|
extra_rdoc_files: []
|
68
|
-
|
69
|
-
files:
|
61
|
+
files:
|
70
62
|
- .gitignore
|
71
63
|
- LICENSE
|
72
64
|
- README.md
|
@@ -83,37 +75,30 @@ files:
|
|
83
75
|
- spec/fixtures/gemsets.yml
|
84
76
|
- spec/fixtures/gemspec.yml
|
85
77
|
- spec/spec_helper.rb
|
86
|
-
has_rdoc: true
|
87
78
|
homepage: http://bleacherreport.com
|
88
79
|
licenses: []
|
89
|
-
|
80
|
+
metadata: {}
|
90
81
|
post_install_message:
|
91
82
|
rdoc_options: []
|
92
|
-
|
93
|
-
require_paths:
|
83
|
+
require_paths:
|
94
84
|
- lib
|
95
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
96
|
-
requirements:
|
97
|
-
- -
|
98
|
-
- !ruby/object:Gem::Version
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
- !ruby/object:Gem::Version
|
106
|
-
segments:
|
107
|
-
- 0
|
108
|
-
version: "0"
|
85
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - '>='
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
109
95
|
requirements: []
|
110
|
-
|
111
96
|
rubyforge_project:
|
112
|
-
rubygems_version:
|
97
|
+
rubygems_version: 2.0.14
|
113
98
|
signing_key:
|
114
|
-
specification_version:
|
99
|
+
specification_version: 4
|
115
100
|
summary: A Ruby Interface to the Bleacher Report API
|
116
|
-
test_files:
|
101
|
+
test_files:
|
117
102
|
- spec/bleacher_api/gems_spec.rb
|
118
103
|
- spec/bleacher_api_spec.rb
|
119
104
|
- spec/fixtures/gemsets.yml
|