sportradar-api 0.9.10 → 0.9.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.env.sample +32 -31
- data/Gemfile.lock +2 -2
- data/lib/sportradar/api/images.rb +17 -8
- data/lib/sportradar/api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43f45cf3872130798f32177ea5e1b52feef6ef92
|
4
|
+
data.tar.gz: efe2db5f89a760d5776bb067c88a20d3d151b5ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69206507d267aface402cf9e51eb00466a24150576c2d27171ddc8e9e4227e2fc58b3c9030065e9c79c8872b32f8ab8c9a1d6786ef49c4d2dda2bf65517e525c
|
7
|
+
data.tar.gz: f94cd2094546efa9c7c4a671943f4a76ac4e61ae3bfb23ce577f5b77f319c2713480f3ff543df186f14178458e56d4ee987a954f5fa4bf666a267825edacde89
|
data/.env.sample
CHANGED
@@ -1,31 +1,32 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
1
|
+
SPORTRADAR_CONTENT_NBA: your-content_nba-api-key
|
2
|
+
SPORTRADAR_CONTENT_NFL: your-content_nfl-api-key
|
3
|
+
SPORTRADAR_CRICKET: your-cricket-api-key
|
4
|
+
SPORTRADAR_ESPORTS_CSGO: your-esports_csgo-api-key
|
5
|
+
SPORTRADAR_GOLF: your-golf-api-key
|
6
|
+
SPORTRADAR_IMAGES_MLS: your-images_mls-api-key
|
7
|
+
SPORTRADAR_IMAGES_NBA: your-images_nba-api-key
|
8
|
+
SPORTRADAR_IMAGES_NFL: your-images_nfl-api-key
|
9
|
+
SPORTRADAR_IMAGES_NFL_OFFICIAL_PREMIUM: your-images_nfl-official-premium-api-key
|
10
|
+
SPORTRADAR_LIVE_IMAGES_MLS: your-live_images_mls-api-key
|
11
|
+
SPORTRADAR_LIVE_IMAGES_NBA: your-live_images_nba-api-key
|
12
|
+
SPORTRADAR_LIVE_IMAGES_NFL: your-live_images_nfl-api-key
|
13
|
+
SPORTRADAR_MLB: your-mlb-api-key
|
14
|
+
SPORTRADAR_MMA: your-mma-api-key
|
15
|
+
SPORTRADAR_NASCAR: your-nascar-api-key
|
16
|
+
SPORTRADAR_NBA: your-nba-api-key
|
17
|
+
SPORTRADAR_NCAAF: your-ncaaf-api-key
|
18
|
+
SPORTRADAR_NCAAMB: your-ncaamb-api-key
|
19
|
+
SPORTRADAR_NCAAWB: your-ncaawb-api-key
|
20
|
+
SPORTRADAR_NFL: your-nfl-api-key
|
21
|
+
SPORTRADAR_NHL: your-nhl-api-key
|
22
|
+
SPORTRADAR_NPB: your-npb-api-key
|
23
|
+
SPORTRADAR_ODDS: your-odds-api-key
|
24
|
+
SPORTRADAR_RUGBY: your-rugby-api-key
|
25
|
+
SPORTRADAR_SOCCER_AF: your-soccer_africa-api-key
|
26
|
+
SPORTRADAR_SOCCER_AS: your-soccer_asia-api-key
|
27
|
+
SPORTRADAR_SOCCER_EU: your-soccer_europe-api-key
|
28
|
+
SPORTRADAR_SOCCER_NA: your-soccer_north-america-api-key
|
29
|
+
SPORTRADAR_SOCCER_SA: your-soccer_south-america-api-key
|
30
|
+
SPORTRADAR_SOCCER_WC: your-soccer_world-cup-api-key
|
31
|
+
SPORTRADAR_TENNIS: your-tennis-api-key
|
32
|
+
SPORTRADAR_WNBA: your-wnba-api-key
|
data/Gemfile.lock
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
module Sportradar
|
2
2
|
module Api
|
3
3
|
class Images < Request
|
4
|
-
attr_accessor :sport, :league, :access_level
|
5
|
-
def initialize( sport, access_level
|
4
|
+
attr_accessor :sport, :league, :access_level, :nfl_premium
|
5
|
+
def initialize( sport, access_level: 't', league: nil, nfl_premium: false)
|
6
6
|
raise Sportradar::Api::Error::InvalidSport unless allowed_sports.include? sport
|
7
7
|
@sport = sport
|
8
8
|
raise Sportradar::Api::Error::InvalidLeague unless soccer_leagues.include?(league) || league.nil?
|
9
9
|
@league = league
|
10
|
-
|
10
|
+
@nfl_premium = nfl_premium
|
11
11
|
raise Sportradar::Api::Error::InvalidAccessLevel unless allowed_access_levels.include? access_level
|
12
12
|
@access_level = access_level
|
13
13
|
end
|
@@ -15,6 +15,8 @@ module Sportradar
|
|
15
15
|
def player_manifests(year = Date.today.year)
|
16
16
|
if league
|
17
17
|
response = get request_url("#{league}/#{image_type}/players/#{year}/manifest")
|
18
|
+
elsif nfl_premium
|
19
|
+
response = get request_url("#{image_type}/players/#{year}/manifest")
|
18
20
|
else
|
19
21
|
response = get request_url("players/#{image_type}/manifests/all_assets")
|
20
22
|
end
|
@@ -67,13 +69,18 @@ module Sportradar
|
|
67
69
|
|
68
70
|
def api_key
|
69
71
|
if league
|
72
|
+
|
70
73
|
if access_level == 'p'
|
71
74
|
Sportradar::Api.api_key_params("images_#{league}", "production")
|
72
75
|
else
|
73
76
|
Sportradar::Api.api_key_params("images_#{league}")
|
74
77
|
end
|
75
78
|
else
|
76
|
-
if access_level == 'p'
|
79
|
+
if nfl_premium && access_level == 'p'
|
80
|
+
Sportradar::Api.api_key_params("images_nfl_official_premium", "production")
|
81
|
+
elsif nfl_premium
|
82
|
+
Sportradar::Api.api_key_params("images_nfl_official_premium")
|
83
|
+
elsif access_level == 'p'
|
77
84
|
Sportradar::Api.api_key_params("images_#{sport}", "production")
|
78
85
|
else
|
79
86
|
Sportradar::Api.api_key_params("images_#{sport}")
|
@@ -86,7 +93,9 @@ module Sportradar
|
|
86
93
|
end
|
87
94
|
|
88
95
|
def provider
|
89
|
-
if
|
96
|
+
if nfl_premium
|
97
|
+
'ap_premium'
|
98
|
+
elsif uses_v2_api?
|
90
99
|
'usat'
|
91
100
|
elsif uses_v3_api?
|
92
101
|
'reuters'
|
@@ -94,10 +103,10 @@ module Sportradar
|
|
94
103
|
end
|
95
104
|
|
96
105
|
def version
|
97
|
-
if
|
98
|
-
Sportradar::Api.version('images')
|
99
|
-
elsif uses_v3_api?
|
106
|
+
if uses_v3_api? || nfl_premium
|
100
107
|
3
|
108
|
+
elsif uses_v2_api?
|
109
|
+
Sportradar::Api.version('images')
|
101
110
|
end
|
102
111
|
end
|
103
112
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sportradar-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Eggett
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|