0.0.2 • Published 2 years ago
wtf-plugin-sports v0.0.2
import wtf from 'wtf_wikipedia'
import {mlb, nhl} from 'wtf-plugin-sports'
wtf.extend(nhl)
let res = await wtf.nhlSeason('Toronto Maple Leafs', 2018)
MLB
wtf-mlb gets structured data for mlb baseball teams, supports a bunch of different variants of mlb game log variations, and tries to cleanup some complicated parts of wikipedia sometimes in the wild.
import wtf from 'wtf_wikipedia'
import {mlb} from 'wtf-plugin-sports'
wtf.extend(mlb)
wtf.mlbSeason('Toronto Blue Jays', 2018).then((data) => {
console.log(data)
/*{
games: [{
date: 'April 1',
team: 'Reds',
home: false,
result: { us: 6, them: 5, win: true },
record: { wins: 3, losses: 0, games: 3
},
...
],
postseason: [...],
roster: [],
draftPicks: [],
playerStats: []
}*/
})
NHL
wtf-nhl gets structured data for nhl hockey teams, supports a bunch of different variants of nhl game log variations, and tries to cleanup some complicated parts of wikipedia sometimes in the wild.
import wtf from 'wtf_wikipedia'
import {nhl} from 'wtf-plugin-sports'
wtf.extend(nhl)
wtf.nhlSeason('Toronto Maple Leafs', 2018).then((data) => {
console.log(data)
/*{
games: [
{
game: 82,
date: 'April 7 2018',
opponent: 'Montreal Canadiens',
result: {
"us": 4,
"them": 2
},
overtime: false,
record: {
"wins": 49,
"losses": 26,
"ties": 7,
"games": 82
},
attendance: null,
points: 105,
win: true
},
...
],
roster: [
{
"name": "Ron Hainsey",
"games": 80,
"goals": 4,
"assists": 19,
"points": 23,
"plusMinus": 12
},
...
],
}*/
})
work-in-progress
MIT