Module: Sportscore
- Defined in:
- lib/sportscore.rb,
lib/sportscore/version.rb
Defined Under Namespace
Classes: Error, RequestError
Constant Summary collapse
- BASE_URL =
"https://sportscore.com"- VERSION =
"0.1.0"
Class Method Summary collapse
-
.bracket(sport:, slug:) ⇒ Object
Knockout tournament bracket Params: sport=..., slug=
/api/widget/bracket. -
.match(sport:, slug:) ⇒ Object
Fetches a single match's detail (score, status, lineups, timeline).
-
.matches(sport:, limit: 10) ⇒ Object
Fetches live + recent matches for a given sport.
-
.player(sport:, slug:) ⇒ Object
Player statistics + metadata.
-
.standings(sport:, slug:) ⇒ Object
Fetches league/competition standings.
-
.team(sport:, slug:, limit: 10) ⇒ Object
Fetches team's recent + upcoming fixtures.
-
.topscorers(sport:, slug:, limit: 10, stat: "goals") ⇒ Object
Fetches top scorers / assists for a competition Params: sport=..., slug=
, limit=1..50, stat=goals|assists /api/widget/topscorers. -
.tracker(sport:, id:) ⇒ Object
Live match tracker proxy (position / animation data).
Class Method Details
.bracket(sport:, slug:) ⇒ Object
Knockout tournament bracket
Params: sport=..., slug=
56 57 58 |
# File 'lib/sportscore.rb', line 56 def self.bracket(sport:, slug:) get("/api/widget/bracket", sport: sport, slug: slug) end |
.match(sport:, slug:) ⇒ Object
Fetches a single match's detail (score, status, lineups, timeline).
Params: sport=..., slug=
21 22 23 |
# File 'lib/sportscore.rb', line 21 def self.match(sport:, slug:) get("/api/widget/match", sport: sport, slug: slug) end |
.matches(sport:, limit: 10) ⇒ Object
Fetches live + recent matches for a given sport. Params: sport=football|basketball|cricket|tennis, limit=1..50 Sportscore.matches(sport: "football", limit: 10)
14 15 16 |
# File 'lib/sportscore.rb', line 14 def self.matches(sport:, limit: 10) get("/api/widget/matches", sport: sport, limit: limit) end |
.player(sport:, slug:) ⇒ Object
Player statistics + metadata.
Params: sport=..., slug=
49 50 51 |
# File 'lib/sportscore.rb', line 49 def self.player(sport:, slug:) get("/api/widget/player", sport: sport, slug: slug) end |
.standings(sport:, slug:) ⇒ Object
Fetches league/competition standings.
Params: sport=..., slug=
35 36 37 |
# File 'lib/sportscore.rb', line 35 def self.standings(sport:, slug:) get("/api/widget/standings", sport: sport, slug: slug) end |
.team(sport:, slug:, limit: 10) ⇒ Object
Fetches team's recent + upcoming fixtures.
Params: sport=..., slug=
28 29 30 |
# File 'lib/sportscore.rb', line 28 def self.team(sport:, slug:, limit: 10) get("/api/widget/team", sport: sport, slug: slug, limit: limit) end |
.topscorers(sport:, slug:, limit: 10, stat: "goals") ⇒ Object
Fetches top scorers / assists for a competition
Params: sport=..., slug=
42 43 44 |
# File 'lib/sportscore.rb', line 42 def self.topscorers(sport:, slug:, limit: 10, stat: "goals") get("/api/widget/topscorers", sport: sport, slug: slug, limit: limit, stat: stat) end |
.tracker(sport:, id:) ⇒ Object
Live match tracker proxy (position / animation data).
Params: sport=..., id=
63 64 65 |
# File 'lib/sportscore.rb', line 63 def self.tracker(sport:, id:) get("/api/widget/tracker", sport: sport, id: id) end |