lolesports-api 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lolesports-api/base.rb +7 -0
- data/lib/lolesports-api/game.rb +22 -8
- data/lib/lolesports-api/match.rb +14 -11
- data/lib/lolesports-api/player.rb +4 -2
- data/lib/lolesports-api/tournament.rb +7 -8
- data/lib/lolesports-api/version.rb +1 -1
- data/spec/fixtures/vcr/cassettes/LolesportsApi_Game/_find/has_the_proper_youtube_url.yml +66 -0
- data/spec/fixtures/vcr/cassettes/LolesportsApi_Game/_find/when_a_game_does_not_have_vods/.yml +65 -0
- data/spec/fixtures/vcr/cassettes/LolesportsApi_Game/_find/when_a_game_has_vods/.yml +66 -0
- data/spec/fixtures/vcr/cassettes/LolesportsApi_Game/_find/when_a_game_has_vods/has_the_proper_youtube_url.yml +66 -0
- data/spec/fixtures/vcr/cassettes/game/future.yml +66 -0
- data/spec/lolesports-api/game_spec.rb +28 -10
- data/spec/lolesports-api/match_spec.rb +2 -0
- data/spec/lolesports-api/player_spec.rb +4 -1
- data/spec/lolesports-api/tournament_spec.rb +1 -0
- data/spec/spec_helper.rb +3 -0
- metadata +12 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e5482b62746f21c7d525986deec46c9a890e0bc
|
4
|
+
data.tar.gz: e40ee605e41f197b796ad38b57918ec525019e0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51936dcbd179ea16d049cca9740a8702decfb55b0db2bebada0f22982412c8dbd9d4fc78bb030b2190b4124752fea0c21fb6c16b1678dd3f038d34272969c726
|
7
|
+
data.tar.gz: 945406636cbaa2b78e00070a2558b911bc071cd2f83e68865b54e3d66d21f2be3c274609162f7fa1d84c0b1d51408897e8c1ca4329dd03b91f001efa767d4fca
|
data/lib/lolesports-api/base.rb
CHANGED
@@ -18,6 +18,7 @@ module LolesportsApi
|
|
18
18
|
response = Faraday.get("#{self.class::API_URL}/#{@id}.json")
|
19
19
|
self.class.fail_by_status(response) unless response.success?
|
20
20
|
@attributes = JSON.parse(response.body)
|
21
|
+
@attributes['id'] = @id
|
21
22
|
initialize(@attributes)
|
22
23
|
self
|
23
24
|
end
|
@@ -27,5 +28,11 @@ module LolesportsApi
|
|
27
28
|
LolesportsApi::Error::ERRORS[response.status] || LolesportsApi::Error
|
28
29
|
fail klass
|
29
30
|
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
def parse_datetime(attribute)
|
35
|
+
DateTime.parse(attribute) if attribute
|
36
|
+
end
|
30
37
|
end
|
31
38
|
end
|
data/lib/lolesports-api/game.rb
CHANGED
@@ -3,7 +3,8 @@ module LolesportsApi
|
|
3
3
|
attr_reader :id, :date_time, :game_length, :game_number,
|
4
4
|
:legs_url, :match_id, :max_games, :no_vods,
|
5
5
|
:platform_game_id, :platform_id, :players,
|
6
|
-
:tournament, :vods, :winner_id, :has_vod
|
6
|
+
:tournament, :vods, :winner_id, :has_vod,
|
7
|
+
:youtube_url
|
7
8
|
|
8
9
|
attr_accessor :blue_team, :red_team
|
9
10
|
|
@@ -16,16 +17,16 @@ module LolesportsApi
|
|
16
17
|
@legs_url = attributes['legsUrl']
|
17
18
|
@match_id = attributes['matchId'].to_i
|
18
19
|
@max_games = attributes['maxGames'].to_i
|
19
|
-
@no_vods = attributes['noVods']
|
20
|
+
@no_vods = (attributes['noVods'] == '1' ? true : false)
|
20
21
|
@platform_game_id = attributes['platformGameId']
|
21
22
|
@platform_id = attributes['platformId']
|
22
23
|
@players = []
|
23
24
|
@tournament = attributes['tournament'] || {}
|
24
25
|
@vods = attributes['vods'] || {}
|
25
|
-
@winner_id = attributes['winnerId'].to_i
|
26
26
|
@has_vod = attributes['hasVod']
|
27
|
-
@
|
28
|
-
|
27
|
+
@winner_id = parse_winner_id(attributes['winnerId'])
|
28
|
+
@date_time = parse_datetime(attributes['dateTime'])
|
29
|
+
@youtube_url = parse_vods(attributes, 'youtube')
|
29
30
|
|
30
31
|
prepare_teams(attributes)
|
31
32
|
|
@@ -34,10 +35,12 @@ module LolesportsApi
|
|
34
35
|
|
35
36
|
def self.find(game_id)
|
36
37
|
super
|
37
|
-
@attributes['players'].each_value do |player|
|
38
|
-
@base_object.players << LolesportsApi::Play.new(player)
|
39
|
-
end
|
40
38
|
@base_object.prepare_teams(@attributes)
|
39
|
+
if @attributes['players'] && @attributes['players'].any?
|
40
|
+
@attributes['players'].each_value do |player|
|
41
|
+
@base_object.players << LolesportsApi::Play.new(player)
|
42
|
+
end
|
43
|
+
end
|
41
44
|
@base_object
|
42
45
|
end
|
43
46
|
|
@@ -46,5 +49,16 @@ module LolesportsApi
|
|
46
49
|
@blue_team = LolesportsApi::Team.new(attrs['contestants']['blue'])
|
47
50
|
@red_team = LolesportsApi::Team.new(attrs['contestants']['red'])
|
48
51
|
end
|
52
|
+
|
53
|
+
private
|
54
|
+
|
55
|
+
def parse_vods(attrs, type)
|
56
|
+
return nil if attrs['hasVod'] == 0 || attrs['vods'].nil?
|
57
|
+
return attrs['vods']['vod']['URL'] if attrs['vods']['vod']['type'] == type
|
58
|
+
end
|
59
|
+
|
60
|
+
def parse_winner_id(attr)
|
61
|
+
attr =~ /^\d+$/ ? attr : nil
|
62
|
+
end
|
49
63
|
end
|
50
64
|
end
|
data/lib/lolesports-api/match.rb
CHANGED
@@ -3,7 +3,7 @@ module LolesportsApi
|
|
3
3
|
attr_reader :id, :blue_team, :red_team, :date_time, :games,
|
4
4
|
:is_finished, :is_live, :live_streams,
|
5
5
|
:max_games, :name, :polldaddy_id, :url,
|
6
|
-
:winner_id
|
6
|
+
:winner_id, :round
|
7
7
|
|
8
8
|
attr_accessor :tournament
|
9
9
|
|
@@ -11,9 +11,8 @@ module LolesportsApi
|
|
11
11
|
|
12
12
|
def initialize(attributes = {})
|
13
13
|
@id = (attributes['id'] || attributes['matchId']).to_i
|
14
|
-
@date_time =
|
15
|
-
|
16
|
-
@is_finished = attributes['isFinished']
|
14
|
+
@date_time = parse_datetime(attributes['dateTime'])
|
15
|
+
@is_finished = (attributes['isFinished'] == '1' ? true : false)
|
17
16
|
@is_live = attributes['isLive']
|
18
17
|
@live_streams = attributes['liveStreams']
|
19
18
|
@max_games = attributes['maxGames']
|
@@ -21,9 +20,12 @@ module LolesportsApi
|
|
21
20
|
@polldaddy_id = attributes['polldaddyId']
|
22
21
|
@tournament = LolesportsApi::Tournament.new(attributes['tournament'])
|
23
22
|
@url = attributes['url']
|
24
|
-
@winner_id = attributes['winnerId']
|
23
|
+
@winner_id = attributes['winnerId'].to_i
|
25
24
|
|
26
|
-
|
25
|
+
if attributes['tournament']
|
26
|
+
@round = attributes['tournament']['round'].to_i
|
27
|
+
end
|
28
|
+
prepare_teams(attributes['contestants'])
|
27
29
|
prepare_games(attributes)
|
28
30
|
|
29
31
|
self
|
@@ -36,17 +38,18 @@ module LolesportsApi
|
|
36
38
|
end
|
37
39
|
|
38
40
|
def prepare_games(attrs)
|
39
|
-
return unless attrs['games']
|
41
|
+
return unless attrs['games'] && attrs['games'].any?
|
40
42
|
@games = []
|
41
43
|
attrs['games'].each_value do |game|
|
42
44
|
@games << LolesportsApi::Game.new(game)
|
43
45
|
end
|
44
46
|
end
|
45
47
|
|
46
|
-
def prepare_teams(
|
47
|
-
return unless
|
48
|
-
|
49
|
-
@
|
48
|
+
def prepare_teams(teams)
|
49
|
+
return unless teams
|
50
|
+
|
51
|
+
@blue_team = LolesportsApi::Team.new(teams['blue']) if teams['blue']
|
52
|
+
@red_team = LolesportsApi::Team.new(teams['red']) if teams['red']
|
50
53
|
end
|
51
54
|
end
|
52
55
|
end
|
@@ -12,16 +12,18 @@ module LolesportsApi
|
|
12
12
|
@name = attributes['name']
|
13
13
|
@bio = attributes['bio']
|
14
14
|
@first_name = attributes['firstname']
|
15
|
-
@last_name = attributes['
|
15
|
+
@last_name = attributes['lastName']
|
16
16
|
@team_id = attributes['teamId']
|
17
17
|
@role = attributes['role']
|
18
18
|
@role_id = attributes['roleId']
|
19
19
|
@is_starter = attributes['isStarter']
|
20
20
|
@hometown = attributes['hometown']
|
21
|
-
@contract_expiration = attributes['contractExpiration']
|
22
21
|
@photo_url = attributes['photoUrl']
|
23
22
|
@profile_url = attributes['profileUrl']
|
24
23
|
@residency = attributes['residency']
|
24
|
+
|
25
|
+
@contract_expiration = parse_datetime(attributes['contractExpiration'])
|
26
|
+
self
|
25
27
|
end
|
26
28
|
|
27
29
|
def self.all
|
@@ -2,17 +2,15 @@ module LolesportsApi
|
|
2
2
|
class Tournament < LolesportsApi::BaseApiObject
|
3
3
|
attr_reader :id, :contestants, :date_begin, :date_end,
|
4
4
|
:is_finished, :name, :name_public, :no_vods,
|
5
|
-
:published, :season, :winner, :
|
5
|
+
:published, :season, :winner, :matches
|
6
6
|
|
7
7
|
API_URL = 'http://na.lolesports.com/api/tournament'
|
8
8
|
|
9
9
|
def initialize(attributes)
|
10
10
|
@id = attributes['id'].to_i
|
11
11
|
@contestants = []
|
12
|
-
@date_begin =
|
13
|
-
|
14
|
-
@date_end =
|
15
|
-
Date.parse(attributes['dateEnd']) if attributes['dateEnd']
|
12
|
+
@date_begin = parse_datetime(attributes['dateBegin'])
|
13
|
+
@date_end = parse_datetime(attributes['dateEnd'])
|
16
14
|
@is_finished = attributes['isFinished']
|
17
15
|
@name = attributes['name']
|
18
16
|
@name_public = attributes['namePublic']
|
@@ -20,7 +18,6 @@ module LolesportsApi
|
|
20
18
|
@published = attributes['published']
|
21
19
|
@season = attributes['season']
|
22
20
|
@winner = attributes['winner'].to_i
|
23
|
-
@round = attributes['round']
|
24
21
|
@matches = []
|
25
22
|
|
26
23
|
self
|
@@ -28,8 +25,10 @@ module LolesportsApi
|
|
28
25
|
|
29
26
|
def self.find(tournament_id)
|
30
27
|
super
|
31
|
-
@attributes['contestants']
|
32
|
-
@
|
28
|
+
if @attributes['contestants'] && @attributes['contestants'].any?
|
29
|
+
@attributes['contestants'].each_value do |contestant|
|
30
|
+
@base_object.contestants << LolesportsApi::Team.new(contestant)
|
31
|
+
end
|
33
32
|
end
|
34
33
|
@base_object
|
35
34
|
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://na.lolesports.com/api/game/2782.json
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.1
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
Accept:
|
15
|
+
- "*/*"
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Date:
|
22
|
+
- Fri, 21 Aug 2015 19:50:28 GMT
|
23
|
+
Content-Type:
|
24
|
+
- application/json
|
25
|
+
Content-Length:
|
26
|
+
- '1197'
|
27
|
+
Connection:
|
28
|
+
- keep-alive
|
29
|
+
Set-Cookie:
|
30
|
+
- __cfduid=d5f67ecb8b011e92eb573b170ec97f6371440186628; expires=Sat, 20-Aug-16
|
31
|
+
19:50:28 GMT; path=/; domain=.lolesports.com; HttpOnly
|
32
|
+
Cache-Control:
|
33
|
+
- public, max-age=1800
|
34
|
+
Etag:
|
35
|
+
- '"1440186402-1"'
|
36
|
+
Expires:
|
37
|
+
- Fri, 21 Aug 2015 20:20:28 GMT
|
38
|
+
Last-Modified:
|
39
|
+
- Fri, 21 Aug 2015 19:46:42 GMT
|
40
|
+
Vary:
|
41
|
+
- Accept-Encoding
|
42
|
+
Via:
|
43
|
+
- 1.1 varnish
|
44
|
+
X-Drupal-Cache:
|
45
|
+
- MISS
|
46
|
+
X-Varnish:
|
47
|
+
- '462730016'
|
48
|
+
X-Varnish-Cache:
|
49
|
+
- MISS
|
50
|
+
Cf-Cache-Status:
|
51
|
+
- HIT
|
52
|
+
Accept-Ranges:
|
53
|
+
- bytes
|
54
|
+
Server:
|
55
|
+
- cloudflare-nginx
|
56
|
+
Cf-Ray:
|
57
|
+
- 2198ddf956d511d1-SJC
|
58
|
+
body:
|
59
|
+
encoding: ASCII-8BIT
|
60
|
+
string: '{"dateTime":"2014-05-21T15:00Z","winnerId":"67","maxGames":"1","gameNumber":"1","gameLength":1414,"matchId":"2299","tournament":{"id":"102","name":"EU
|
61
|
+
LCS Summer Split","round":"1"},"platformId":null,"platformGameId":null,"vods":{"vod":{"type":"youtube","URL":"http://www.youtube.com/watch?v=_bsRoa3u0t8","embedCode":null}},"contestants":{"blue":{"id":"67","name":"SK
|
62
|
+
Gaming","logoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/sk-white.png"},"red":{"id":"1100","name":"Copenhagen
|
63
|
+
Wolves","logoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/Wolveslogobund.png"}},"players":{"player0":{"id":1124,"teamId":67,"name":"fredy122","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/sk-fredy122-2015Summer.jpg","kda":10,"kills":8,"deaths":1,"assists":2,"endLevel":13,"minionsKilled":136,"totalGold":10240,"spell0":"4","spell1":"12","items0":"3153","items1":"3111","items2":"3044","items3":"1055","items4":"1055","items5":"3057","championId":24},"player1":{"id":1125,"teamId":67,"name":"Svenskeren","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/SK-svenskeren-2015Summer.jpg","kda":4.5,"kills":2,"deaths":2,"assists":7,"endLevel":13,"minionsKilled":92,"totalGold":8353,"spell0":"11","spell1":"4","items0":"3209","items1":"3143","items2":"2049","items3":"0","items4":"0","items5":"3047","championId":28},"player2":{"id":1126,"teamId":67,"name":"Jesse","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/cst-jesiz-2015.jpg","kda":14,"kills":10,"deaths":0,"assists":4,"endLevel":16,"minionsKilled":249,"totalGold":13140,"spell0":"4","spell1":"14","items0":"3115","items1":"3252","items2":"3085","items3":"1026","items4":"1056","items5":"3100","championId":10},"player3":{"id":118,"teamId":67,"name":"CandyPanda","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/sk-candypanda-2015summer.jpg","kda":7,"kills":1,"deaths":1,"assists":6,"endLevel":14,"minionsKilled":205,"totalGold":9863,"spell0":"4","spell1":"7","items0":"1055","items1":"3072","items2":"3006","items3":"3044","items4":"3035","items5":"1042","championId":236},"player4":{"id":79,"teamId":67,"name":"nRated","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/sk-nrated-2015Summer.jpg","kda":12,"kills":0,"deaths":0,"assists":12,"endLevel":12,"minionsKilled":20,"totalGold":7975,"spell0":"4","spell1":"3","items0":"3092","items1":"3222","items2":"2049","items3":"2043","items4":"3117","items5":"1057","championId":25},"player5":{"id":1101,"teamId":1100,"name":"YoungBuck","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/CW-youngbuck-2015.jpg","kda":0.4,"kills":0,"deaths":5,"assists":2,"endLevel":11,"minionsKilled":124,"totalGold":5788,"spell0":"4","spell1":"12","items0":"1056","items1":"3028","items2":"1056","items3":"3108","items4":"3020","items5":"1056","championId":117},"player6":{"id":1491,"teamId":1100,"name":"Airwaks","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/CW-airwalks-2015.jpg","kda":1,"kills":1,"deaths":4,"assists":3,"endLevel":11,"minionsKilled":61,"totalGold":5592,"spell0":"4","spell1":"11","items0":"3209","items1":"2049","items2":"1011","items3":"1001","items4":"0","items5":"0","championId":64},"player7":{"id":1103,"teamId":1100,"name":"cowTard","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/COW-TARD.CW_lolesports.PP__0.jpg","kda":0.5,"kills":2,"deaths":4,"assists":0,"endLevel":13,"minionsKilled":206,"totalGold":7574,"spell0":"4","spell1":"3","items0":"3144","items1":"1055","items2":"3250","items3":"3087","items4":"1042","items5":"1042","championId":157},"player8":{"id":1471,"teamId":1100,"name":"Woolite","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/roc-woolite-2015Summer.jpg","kda":0.33333333333333,"kills":1,"deaths":3,"assists":0,"endLevel":11,"minionsKilled":177,"totalGold":6957,"spell0":"4","spell1":"7","items0":"3006","items1":"1055","items2":"3072","items3":"3035","items4":"0","items5":"0","championId":104},"player9":{"id":1105,"teamId":1100,"name":"Unlimited","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/CW-unlimited-2015.jpg","kda":0.4,"kills":0,"deaths":5,"assists":2,"endLevel":10,"minionsKilled":12,"totalGold":4883,"spell0":"3","spell1":"4","items0":"1033","items1":"3098","items2":"2049","items3":"2043","items4":"1001","items5":"3108","championId":143}},"noVods":0,"legsUrl":null}'
|
64
|
+
http_version:
|
65
|
+
recorded_at: Fri, 21 Aug 2015 19:50:29 GMT
|
66
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,65 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://na.lolesports.com/api/game/5334.json
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.1
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
Accept:
|
15
|
+
- "*/*"
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Date:
|
22
|
+
- Sat, 22 Aug 2015 16:35:16 GMT
|
23
|
+
Content-Type:
|
24
|
+
- application/json
|
25
|
+
Content-Length:
|
26
|
+
- '628'
|
27
|
+
Connection:
|
28
|
+
- keep-alive
|
29
|
+
Set-Cookie:
|
30
|
+
- __cfduid=df180ed9b3746955f8db7b2976b7ba4451440261316; expires=Sun, 21-Aug-16
|
31
|
+
16:35:16 GMT; path=/; domain=.lolesports.com; HttpOnly
|
32
|
+
Cache-Control:
|
33
|
+
- public, max-age=1800
|
34
|
+
Etag:
|
35
|
+
- '"1440260914-1"'
|
36
|
+
Expires:
|
37
|
+
- Sat, 22 Aug 2015 17:05:16 GMT
|
38
|
+
Last-Modified:
|
39
|
+
- Sat, 22 Aug 2015 16:28:34 GMT
|
40
|
+
Vary:
|
41
|
+
- Accept-Encoding
|
42
|
+
Via:
|
43
|
+
- 1.1 varnish
|
44
|
+
X-Drupal-Cache:
|
45
|
+
- MISS
|
46
|
+
X-Varnish:
|
47
|
+
- '526138886'
|
48
|
+
X-Varnish-Cache:
|
49
|
+
- MISS
|
50
|
+
Cf-Cache-Status:
|
51
|
+
- HIT
|
52
|
+
Accept-Ranges:
|
53
|
+
- bytes
|
54
|
+
Server:
|
55
|
+
- cloudflare-nginx
|
56
|
+
Cf-Ray:
|
57
|
+
- 219ffd69fc4d0296-SJC
|
58
|
+
body:
|
59
|
+
encoding: ASCII-8BIT
|
60
|
+
string: '{"dateTime":"2015-02-06T05:00Z","winnerId":"1847","maxGames":"2","gameNumber":"1","gameLength":0,"matchId":"4290","tournament":{"id":"204","name":"LPL
|
61
|
+
Spring","round":"4"},"platformId":null,"platformGameId":null,"vods":null,"contestants":{"blue":{"id":"1847","name":"Edward
|
62
|
+
Gaming","logoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/EDG-logo_0.png"},"red":{"id":"3752","name":"Master3","logoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/m3-logo.png"}},"players":{"player0":{"id":3769,"teamId":3752,"name":"Candy","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/templateSilhoutte_4.jpg","kda":null,"kills":null,"deaths":null,"assists":null,"endLevel":null,"minionsKilled":null,"totalGold":null,"spell0":"","spell1":"","items0":"","championId":0},"player1":{"id":3185,"teamId":3752,"name":"Soist","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/templateSilhoutte_4.jpg","kda":null,"kills":null,"deaths":null,"assists":null,"endLevel":null,"minionsKilled":null,"totalGold":null,"spell0":"","spell1":"","items0":"","championId":0},"player2":{"id":2078,"teamId":3752,"name":"lovecd","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/M3-LoveCD-2015lpl.jpg","kda":null,"kills":null,"deaths":null,"assists":null,"endLevel":null,"minionsKilled":null,"totalGold":null,"spell0":"","spell1":"","items0":"","championId":0},"player3":{"id":3184,"teamId":3752,"name":"xr","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/templateSilhoutte_4.jpg","kda":null,"kills":null,"deaths":null,"assists":null,"endLevel":null,"minionsKilled":null,"totalGold":null,"spell0":"","spell1":"","items0":"","championId":0},"player4":{"id":680,"teamId":3752,"name":"dade","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/M3-Dade-2015lpl.jpg","kda":null,"kills":null,"deaths":null,"assists":null,"endLevel":null,"minionsKilled":null,"totalGold":null,"spell0":"","spell1":"","items0":"","championId":0},"player5":{"id":2088,"teamId":1847,"name":"Koro1","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/EDG-Koro-2015lpl.jpg","kda":null,"kills":null,"deaths":null,"assists":null,"endLevel":null,"minionsKilled":null,"totalGold":null,"spell0":"","spell1":"","items0":"","championId":0},"player6":{"id":2089,"teamId":1847,"name":"Clearlove","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/EDG-Clearlove-2015lpl.jpg","kda":null,"kills":null,"deaths":null,"assists":null,"endLevel":null,"minionsKilled":null,"totalGold":null,"spell0":"","spell1":"","items0":"","championId":0},"player7":{"id":983,"teamId":1847,"name":"Pawn","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/EDG-Pawn-2015lpl.jpg","kda":null,"kills":null,"deaths":null,"assists":null,"endLevel":null,"minionsKilled":null,"totalGold":null,"spell0":"","spell1":"","items0":"","championId":0},"player8":{"id":2086,"teamId":1847,"name":"FZZF","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/FZZF.jpg","kda":null,"kills":null,"deaths":null,"assists":null,"endLevel":null,"minionsKilled":null,"totalGold":null,"spell0":"","spell1":"","items0":"","championId":0},"player9":{"id":2091,"teamId":1847,"name":"Blackloli","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/Fireloli.jpg","kda":null,"kills":null,"deaths":null,"assists":null,"endLevel":null,"minionsKilled":null,"totalGold":null,"spell0":"","spell1":"","items0":"","championId":0}},"noVods":1,"legsUrl":false}'
|
63
|
+
http_version:
|
64
|
+
recorded_at: Sat, 22 Aug 2015 16:35:17 GMT
|
65
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,66 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://na.lolesports.com/api/game/2782.json
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.1
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
Accept:
|
15
|
+
- "*/*"
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Date:
|
22
|
+
- Sat, 22 Aug 2015 16:35:15 GMT
|
23
|
+
Content-Type:
|
24
|
+
- application/json
|
25
|
+
Content-Length:
|
26
|
+
- '1197'
|
27
|
+
Connection:
|
28
|
+
- keep-alive
|
29
|
+
Set-Cookie:
|
30
|
+
- __cfduid=df568cd5b0644da650e67cdfec4c726411440261314; expires=Sun, 21-Aug-16
|
31
|
+
16:35:14 GMT; path=/; domain=.lolesports.com; HttpOnly
|
32
|
+
Cache-Control:
|
33
|
+
- public, max-age=1800
|
34
|
+
Etag:
|
35
|
+
- '"1440261322-1"'
|
36
|
+
Expires:
|
37
|
+
- Sat, 22 Aug 2015 17:05:15 GMT
|
38
|
+
Last-Modified:
|
39
|
+
- Sat, 22 Aug 2015 16:35:22 GMT
|
40
|
+
Vary:
|
41
|
+
- Accept-Encoding
|
42
|
+
Via:
|
43
|
+
- 1.1 varnish
|
44
|
+
X-Drupal-Cache:
|
45
|
+
- MISS
|
46
|
+
X-Varnish:
|
47
|
+
- '463133461'
|
48
|
+
X-Varnish-Cache:
|
49
|
+
- MISS
|
50
|
+
Cf-Cache-Status:
|
51
|
+
- EXPIRED
|
52
|
+
Accept-Ranges:
|
53
|
+
- bytes
|
54
|
+
Server:
|
55
|
+
- cloudflare-nginx
|
56
|
+
Cf-Ray:
|
57
|
+
- 219ffd603d2b11f5-SJC
|
58
|
+
body:
|
59
|
+
encoding: ASCII-8BIT
|
60
|
+
string: '{"dateTime":"2014-05-21T15:00Z","winnerId":"67","maxGames":"1","gameNumber":"1","gameLength":1414,"matchId":"2299","tournament":{"id":"102","name":"EU
|
61
|
+
LCS Summer Split","round":"1"},"platformId":null,"platformGameId":null,"vods":{"vod":{"type":"youtube","URL":"http://www.youtube.com/watch?v=_bsRoa3u0t8","embedCode":null}},"contestants":{"blue":{"id":"67","name":"SK
|
62
|
+
Gaming","logoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/sk-white.png"},"red":{"id":"1100","name":"Copenhagen
|
63
|
+
Wolves","logoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/Wolveslogobund.png"}},"players":{"player0":{"id":1124,"teamId":67,"name":"fredy122","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/sk-fredy122-2015Summer.jpg","kda":10,"kills":8,"deaths":1,"assists":2,"endLevel":13,"minionsKilled":136,"totalGold":10240,"spell0":"4","spell1":"12","items0":"3153","items1":"3111","items2":"3044","items3":"1055","items4":"1055","items5":"3057","championId":24},"player1":{"id":1125,"teamId":67,"name":"Svenskeren","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/SK-svenskeren-2015Summer.jpg","kda":4.5,"kills":2,"deaths":2,"assists":7,"endLevel":13,"minionsKilled":92,"totalGold":8353,"spell0":"11","spell1":"4","items0":"3209","items1":"3143","items2":"2049","items3":"0","items4":"0","items5":"3047","championId":28},"player2":{"id":1126,"teamId":67,"name":"Jesse","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/cst-jesiz-2015.jpg","kda":14,"kills":10,"deaths":0,"assists":4,"endLevel":16,"minionsKilled":249,"totalGold":13140,"spell0":"4","spell1":"14","items0":"3115","items1":"3252","items2":"3085","items3":"1026","items4":"1056","items5":"3100","championId":10},"player3":{"id":118,"teamId":67,"name":"CandyPanda","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/sk-candypanda-2015summer.jpg","kda":7,"kills":1,"deaths":1,"assists":6,"endLevel":14,"minionsKilled":205,"totalGold":9863,"spell0":"4","spell1":"7","items0":"1055","items1":"3072","items2":"3006","items3":"3044","items4":"3035","items5":"1042","championId":236},"player4":{"id":79,"teamId":67,"name":"nRated","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/sk-nrated-2015Summer.jpg","kda":12,"kills":0,"deaths":0,"assists":12,"endLevel":12,"minionsKilled":20,"totalGold":7975,"spell0":"4","spell1":"3","items0":"3092","items1":"3222","items2":"2049","items3":"2043","items4":"3117","items5":"1057","championId":25},"player5":{"id":1101,"teamId":1100,"name":"YoungBuck","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/CW-youngbuck-2015.jpg","kda":0.4,"kills":0,"deaths":5,"assists":2,"endLevel":11,"minionsKilled":124,"totalGold":5788,"spell0":"4","spell1":"12","items0":"1056","items1":"3028","items2":"1056","items3":"3108","items4":"3020","items5":"1056","championId":117},"player6":{"id":1491,"teamId":1100,"name":"Airwaks","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/CW-airwalks-2015.jpg","kda":1,"kills":1,"deaths":4,"assists":3,"endLevel":11,"minionsKilled":61,"totalGold":5592,"spell0":"4","spell1":"11","items0":"3209","items1":"2049","items2":"1011","items3":"1001","items4":"0","items5":"0","championId":64},"player7":{"id":1103,"teamId":1100,"name":"cowTard","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/COW-TARD.CW_lolesports.PP__0.jpg","kda":0.5,"kills":2,"deaths":4,"assists":0,"endLevel":13,"minionsKilled":206,"totalGold":7574,"spell0":"4","spell1":"3","items0":"3144","items1":"1055","items2":"3250","items3":"3087","items4":"1042","items5":"1042","championId":157},"player8":{"id":1471,"teamId":1100,"name":"Woolite","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/roc-woolite-2015Summer.jpg","kda":0.33333333333333,"kills":1,"deaths":3,"assists":0,"endLevel":11,"minionsKilled":177,"totalGold":6957,"spell0":"4","spell1":"7","items0":"3006","items1":"1055","items2":"3072","items3":"3035","items4":"0","items5":"0","championId":104},"player9":{"id":1105,"teamId":1100,"name":"Unlimited","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/CW-unlimited-2015.jpg","kda":0.4,"kills":0,"deaths":5,"assists":2,"endLevel":10,"minionsKilled":12,"totalGold":4883,"spell0":"3","spell1":"4","items0":"1033","items1":"3098","items2":"2049","items3":"2043","items4":"1001","items5":"3108","championId":143}},"noVods":0,"legsUrl":null}'
|
64
|
+
http_version:
|
65
|
+
recorded_at: Sat, 22 Aug 2015 16:35:16 GMT
|
66
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,66 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://na.lolesports.com/api/game/2782.json
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.1
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
Accept:
|
15
|
+
- "*/*"
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Date:
|
22
|
+
- Sat, 22 Aug 2015 16:35:16 GMT
|
23
|
+
Content-Type:
|
24
|
+
- application/json
|
25
|
+
Content-Length:
|
26
|
+
- '1197'
|
27
|
+
Connection:
|
28
|
+
- keep-alive
|
29
|
+
Set-Cookie:
|
30
|
+
- __cfduid=d79457798bfe6cc293cd63a1d9dd9ed051440261316; expires=Sun, 21-Aug-16
|
31
|
+
16:35:16 GMT; path=/; domain=.lolesports.com; HttpOnly
|
32
|
+
Cache-Control:
|
33
|
+
- public, max-age=1800
|
34
|
+
Etag:
|
35
|
+
- '"1440261322-1"'
|
36
|
+
Expires:
|
37
|
+
- Sat, 22 Aug 2015 17:05:16 GMT
|
38
|
+
Last-Modified:
|
39
|
+
- Sat, 22 Aug 2015 16:35:22 GMT
|
40
|
+
Vary:
|
41
|
+
- Accept-Encoding
|
42
|
+
Via:
|
43
|
+
- 1.1 varnish
|
44
|
+
X-Drupal-Cache:
|
45
|
+
- MISS
|
46
|
+
X-Varnish:
|
47
|
+
- '463133461'
|
48
|
+
X-Varnish-Cache:
|
49
|
+
- MISS
|
50
|
+
Cf-Cache-Status:
|
51
|
+
- HIT
|
52
|
+
Accept-Ranges:
|
53
|
+
- bytes
|
54
|
+
Server:
|
55
|
+
- cloudflare-nginx
|
56
|
+
Cf-Ray:
|
57
|
+
- 219ffd69612a1ead-SJC
|
58
|
+
body:
|
59
|
+
encoding: ASCII-8BIT
|
60
|
+
string: '{"dateTime":"2014-05-21T15:00Z","winnerId":"67","maxGames":"1","gameNumber":"1","gameLength":1414,"matchId":"2299","tournament":{"id":"102","name":"EU
|
61
|
+
LCS Summer Split","round":"1"},"platformId":null,"platformGameId":null,"vods":{"vod":{"type":"youtube","URL":"http://www.youtube.com/watch?v=_bsRoa3u0t8","embedCode":null}},"contestants":{"blue":{"id":"67","name":"SK
|
62
|
+
Gaming","logoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/sk-white.png"},"red":{"id":"1100","name":"Copenhagen
|
63
|
+
Wolves","logoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/Wolveslogobund.png"}},"players":{"player0":{"id":1124,"teamId":67,"name":"fredy122","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/sk-fredy122-2015Summer.jpg","kda":10,"kills":8,"deaths":1,"assists":2,"endLevel":13,"minionsKilled":136,"totalGold":10240,"spell0":"4","spell1":"12","items0":"3153","items1":"3111","items2":"3044","items3":"1055","items4":"1055","items5":"3057","championId":24},"player1":{"id":1125,"teamId":67,"name":"Svenskeren","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/SK-svenskeren-2015Summer.jpg","kda":4.5,"kills":2,"deaths":2,"assists":7,"endLevel":13,"minionsKilled":92,"totalGold":8353,"spell0":"11","spell1":"4","items0":"3209","items1":"3143","items2":"2049","items3":"0","items4":"0","items5":"3047","championId":28},"player2":{"id":1126,"teamId":67,"name":"Jesse","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/cst-jesiz-2015.jpg","kda":14,"kills":10,"deaths":0,"assists":4,"endLevel":16,"minionsKilled":249,"totalGold":13140,"spell0":"4","spell1":"14","items0":"3115","items1":"3252","items2":"3085","items3":"1026","items4":"1056","items5":"3100","championId":10},"player3":{"id":118,"teamId":67,"name":"CandyPanda","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/sk-candypanda-2015summer.jpg","kda":7,"kills":1,"deaths":1,"assists":6,"endLevel":14,"minionsKilled":205,"totalGold":9863,"spell0":"4","spell1":"7","items0":"1055","items1":"3072","items2":"3006","items3":"3044","items4":"3035","items5":"1042","championId":236},"player4":{"id":79,"teamId":67,"name":"nRated","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/sk-nrated-2015Summer.jpg","kda":12,"kills":0,"deaths":0,"assists":12,"endLevel":12,"minionsKilled":20,"totalGold":7975,"spell0":"4","spell1":"3","items0":"3092","items1":"3222","items2":"2049","items3":"2043","items4":"3117","items5":"1057","championId":25},"player5":{"id":1101,"teamId":1100,"name":"YoungBuck","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/CW-youngbuck-2015.jpg","kda":0.4,"kills":0,"deaths":5,"assists":2,"endLevel":11,"minionsKilled":124,"totalGold":5788,"spell0":"4","spell1":"12","items0":"1056","items1":"3028","items2":"1056","items3":"3108","items4":"3020","items5":"1056","championId":117},"player6":{"id":1491,"teamId":1100,"name":"Airwaks","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/CW-airwalks-2015.jpg","kda":1,"kills":1,"deaths":4,"assists":3,"endLevel":11,"minionsKilled":61,"totalGold":5592,"spell0":"4","spell1":"11","items0":"3209","items1":"2049","items2":"1011","items3":"1001","items4":"0","items5":"0","championId":64},"player7":{"id":1103,"teamId":1100,"name":"cowTard","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/COW-TARD.CW_lolesports.PP__0.jpg","kda":0.5,"kills":2,"deaths":4,"assists":0,"endLevel":13,"minionsKilled":206,"totalGold":7574,"spell0":"4","spell1":"3","items0":"3144","items1":"1055","items2":"3250","items3":"3087","items4":"1042","items5":"1042","championId":157},"player8":{"id":1471,"teamId":1100,"name":"Woolite","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/roc-woolite-2015Summer.jpg","kda":0.33333333333333,"kills":1,"deaths":3,"assists":0,"endLevel":11,"minionsKilled":177,"totalGold":6957,"spell0":"4","spell1":"7","items0":"3006","items1":"1055","items2":"3072","items3":"3035","items4":"0","items5":"0","championId":104},"player9":{"id":1105,"teamId":1100,"name":"Unlimited","photoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/CW-unlimited-2015.jpg","kda":0.4,"kills":0,"deaths":5,"assists":2,"endLevel":10,"minionsKilled":12,"totalGold":4883,"spell0":"3","spell1":"4","items0":"1033","items1":"3098","items2":"2049","items3":"2043","items4":"1001","items5":"3108","championId":143}},"noVods":0,"legsUrl":null}'
|
64
|
+
http_version:
|
65
|
+
recorded_at: Sat, 22 Aug 2015 16:35:17 GMT
|
66
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,66 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://na.lolesports.com/api/game/7071.json
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.1
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
Accept:
|
15
|
+
- "*/*"
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Date:
|
22
|
+
- Sat, 22 Aug 2015 21:44:33 GMT
|
23
|
+
Content-Type:
|
24
|
+
- application/json
|
25
|
+
Content-Length:
|
26
|
+
- '344'
|
27
|
+
Connection:
|
28
|
+
- keep-alive
|
29
|
+
Set-Cookie:
|
30
|
+
- __cfduid=d8187450b9cf944571019106fa26119de1440279873; expires=Sun, 21-Aug-16
|
31
|
+
21:44:33 GMT; path=/; domain=.lolesports.com; HttpOnly
|
32
|
+
Cache-Control:
|
33
|
+
- public, max-age=1800
|
34
|
+
Etag:
|
35
|
+
- '"1440279588-1"'
|
36
|
+
Expires:
|
37
|
+
- Sat, 22 Aug 2015 22:14:33 GMT
|
38
|
+
Last-Modified:
|
39
|
+
- Sat, 22 Aug 2015 21:39:48 GMT
|
40
|
+
Vary:
|
41
|
+
- Accept-Encoding
|
42
|
+
Via:
|
43
|
+
- 1.1 varnish
|
44
|
+
X-Drupal-Cache:
|
45
|
+
- MISS
|
46
|
+
X-Varnish:
|
47
|
+
- '526260569'
|
48
|
+
X-Varnish-Cache:
|
49
|
+
- MISS
|
50
|
+
Cf-Cache-Status:
|
51
|
+
- HIT
|
52
|
+
Accept-Ranges:
|
53
|
+
- bytes
|
54
|
+
Server:
|
55
|
+
- cloudflare-nginx
|
56
|
+
Cf-Ray:
|
57
|
+
- 21a1c276555f1eb9-SJC
|
58
|
+
body:
|
59
|
+
encoding: ASCII-8BIT
|
60
|
+
string: '{"dateTime":null,"winnerId":null,"maxGames":"5","gameNumber":"1","gameLength":null,"matchId":"5338","tournament":{"id":"241","name":"2015
|
61
|
+
NA LCS Summer Playoffs","round":"3"},"platformId":null,"platformGameId":null,"vods":null,"contestants":{"blue":{"id":"1","name":"Team
|
62
|
+
SoloMid","logoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/TSM%20logovector%20-white.png"},"red":{"id":"2","name":"Counter
|
63
|
+
Logic Gaming","logoURL":"http://riot-web-cdn.s3-us-west-1.amazonaws.com/lolesports/s3fs-public/600px-Clg_logo2.png"}},"players":[],"noVods":0,"legsUrl":false}'
|
64
|
+
http_version:
|
65
|
+
recorded_at: Sat, 22 Aug 2015 21:44:36 GMT
|
66
|
+
recorded_with: VCR 2.9.3
|
@@ -1,14 +1,32 @@
|
|
1
1
|
describe LolesportsApi::Game do
|
2
2
|
describe '.find', vcr: true do
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
3
|
+
context 'when a game has vods' do
|
4
|
+
let(:game) { LolesportsApi::Game.find(2782) }
|
5
|
+
it { expect(game.class).to eq LolesportsApi::Game }
|
6
|
+
it { expect(game.game_length).to eq 1414 }
|
7
|
+
it { expect(game.id).to eq 2782 }
|
8
|
+
it { expect(game.players.first.class).to eq LolesportsApi::Play }
|
9
|
+
it { expect(game.players[4].total_gold).to eq 7975 }
|
10
|
+
it { expect(game.players[4].player_id).to eq 79 }
|
11
|
+
it { expect(game.blue_team.id).to eq 67 }
|
12
|
+
it { expect(game.red_team.name).to eq 'Copenhagen Wolves' }
|
13
|
+
it { expect(game.date_time).to eq DateTime.new(2014, 5, 21, 15) }
|
14
|
+
it 'has the proper youtube_url' do
|
15
|
+
expect(game.youtube_url).to eq 'http://www.youtube.com/watch?v=_bsRoa3u0t8'
|
16
|
+
end
|
17
|
+
end
|
18
|
+
context 'when a game does not have vods' do
|
19
|
+
let(:game) { LolesportsApi::Game.find(5334) }
|
20
|
+
it { expect(game.youtube_url).to eq nil }
|
21
|
+
end
|
22
|
+
context 'when a game is in the future' do
|
23
|
+
let(:game) do
|
24
|
+
VCR.use_cassette('game/future') do
|
25
|
+
LolesportsApi::Game.find(7071)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
it { expect(game.id).to eq 7071 }
|
29
|
+
it { expect(game.winner_id).to eq nil }
|
30
|
+
end
|
13
31
|
end
|
14
32
|
end
|
@@ -10,5 +10,7 @@ describe LolesportsApi::Match do
|
|
10
10
|
it { expect(match.games[0].id).to eq 2782 }
|
11
11
|
it { expect(match.tournament.id).to eq 102 }
|
12
12
|
it { expect(match.tournament.name).to eq 'EU LCS Summer Split' }
|
13
|
+
it { expect(match.winner_id).to eq 67 }
|
14
|
+
it { expect(match.is_finished).to eq true }
|
13
15
|
end
|
14
16
|
end
|
@@ -3,7 +3,9 @@ describe LolesportsApi::Player do
|
|
3
3
|
let(:player) { LolesportsApi::Player.find(330) }
|
4
4
|
it { expect(player.class).to eq LolesportsApi::Player }
|
5
5
|
it { expect(player.first_name).to eq 'Hai' }
|
6
|
+
it { expect(player.last_name).to eq 'Lam' }
|
6
7
|
it { expect(player.id).to eq 330 }
|
8
|
+
it { expect(player.contract_expiration).to eq DateTime.new(2015, 10, 7) }
|
7
9
|
end
|
8
10
|
|
9
11
|
describe '.all' do
|
@@ -14,12 +16,13 @@ describe LolesportsApi::Player do
|
|
14
16
|
end
|
15
17
|
end
|
16
18
|
|
17
|
-
describe '#reload', vcr: true
|
19
|
+
describe '#reload', vcr: true do
|
18
20
|
let(:player) { LolesportsApi::Player.new('playerId' => '329') }
|
19
21
|
before(:each) do
|
20
22
|
player.reload
|
21
23
|
end
|
22
24
|
it { expect(player.class).to eq LolesportsApi::Player }
|
23
25
|
it { expect(player.first_name).to eq 'William' }
|
26
|
+
it { expect(player.id).to eq 329 }
|
24
27
|
end
|
25
28
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -99,6 +99,9 @@ RSpec.configure do |config|
|
|
99
99
|
# # test failures related to randomization by passing the same `--seed` value
|
100
100
|
# # as the one that triggered the failure.
|
101
101
|
# Kernel.srand config.seed
|
102
|
+
|
103
|
+
config.filter_run focus: true
|
104
|
+
config.run_all_when_everything_filtered = true
|
102
105
|
end
|
103
106
|
|
104
107
|
VCR.configure do |config|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lolesports-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jake Mays
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08
|
11
|
+
date: 2015-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -193,6 +193,10 @@ files:
|
|
193
193
|
- lib/lolesports-api/version.rb
|
194
194
|
- lolesports-api.gemspec
|
195
195
|
- spec/fixtures/vcr/cassettes/LolesportsApi_Game/_find/.yml
|
196
|
+
- spec/fixtures/vcr/cassettes/LolesportsApi_Game/_find/has_the_proper_youtube_url.yml
|
197
|
+
- spec/fixtures/vcr/cassettes/LolesportsApi_Game/_find/when_a_game_does_not_have_vods/.yml
|
198
|
+
- spec/fixtures/vcr/cassettes/LolesportsApi_Game/_find/when_a_game_has_vods/.yml
|
199
|
+
- spec/fixtures/vcr/cassettes/LolesportsApi_Game/_find/when_a_game_has_vods/has_the_proper_youtube_url.yml
|
196
200
|
- spec/fixtures/vcr/cassettes/LolesportsApi_League/_all/.yml
|
197
201
|
- spec/fixtures/vcr/cassettes/LolesportsApi_League/_find/.yml
|
198
202
|
- spec/fixtures/vcr/cassettes/LolesportsApi_Match/_find/.yml
|
@@ -205,6 +209,7 @@ files:
|
|
205
209
|
- spec/fixtures/vcr/cassettes/LolesportsApi_Tournament/_find/when_the_Tournament_is_available/.yml
|
206
210
|
- spec/fixtures/vcr/cassettes/LolesportsApi_Tournament/_find/when_the_Tournament_is_only_for_authorized_accounts/raises_LolesportsApi_Error_UnauthorizedAccess.yml
|
207
211
|
- spec/fixtures/vcr/cassettes/LolesportsApi_Tournament/_find_matches/.yml
|
212
|
+
- spec/fixtures/vcr/cassettes/game/future.yml
|
208
213
|
- spec/lolesports-api/error_spec.rb
|
209
214
|
- spec/lolesports-api/game_spec.rb
|
210
215
|
- spec/lolesports-api/league_spec.rb
|
@@ -241,6 +246,10 @@ specification_version: 4
|
|
241
246
|
summary: Wraps the lolesports API.
|
242
247
|
test_files:
|
243
248
|
- spec/fixtures/vcr/cassettes/LolesportsApi_Game/_find/.yml
|
249
|
+
- spec/fixtures/vcr/cassettes/LolesportsApi_Game/_find/has_the_proper_youtube_url.yml
|
250
|
+
- spec/fixtures/vcr/cassettes/LolesportsApi_Game/_find/when_a_game_does_not_have_vods/.yml
|
251
|
+
- spec/fixtures/vcr/cassettes/LolesportsApi_Game/_find/when_a_game_has_vods/.yml
|
252
|
+
- spec/fixtures/vcr/cassettes/LolesportsApi_Game/_find/when_a_game_has_vods/has_the_proper_youtube_url.yml
|
244
253
|
- spec/fixtures/vcr/cassettes/LolesportsApi_League/_all/.yml
|
245
254
|
- spec/fixtures/vcr/cassettes/LolesportsApi_League/_find/.yml
|
246
255
|
- spec/fixtures/vcr/cassettes/LolesportsApi_Match/_find/.yml
|
@@ -253,6 +262,7 @@ test_files:
|
|
253
262
|
- spec/fixtures/vcr/cassettes/LolesportsApi_Tournament/_find/when_the_Tournament_is_available/.yml
|
254
263
|
- spec/fixtures/vcr/cassettes/LolesportsApi_Tournament/_find/when_the_Tournament_is_only_for_authorized_accounts/raises_LolesportsApi_Error_UnauthorizedAccess.yml
|
255
264
|
- spec/fixtures/vcr/cassettes/LolesportsApi_Tournament/_find_matches/.yml
|
265
|
+
- spec/fixtures/vcr/cassettes/game/future.yml
|
256
266
|
- spec/lolesports-api/error_spec.rb
|
257
267
|
- spec/lolesports-api/game_spec.rb
|
258
268
|
- spec/lolesports-api/league_spec.rb
|