1.1.3 • Published 5 years ago

wtf-mlb v1.1.3

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

wtf-mlb is a wrapper of wtf_wikipedia that supports a bunch of different variants of mlb game log variations, that are used sometimes in the wild.

wtfMLB.fetch('Toronto Blue Jays', 2018).then(console.log)
//[{
//   date: 'April 1',
//   team: 'Reds',
//   home: false,
//   result: { us: 6, them: 5, win: true },
//   record: { wins: 3, losses: 0, games: 3
// },
//  ....


//or if you already have the doc,
var json = wtfMLB.parse(doc)

to do a bunch of years in a row:

wtfMLB.history('St. Louis Cardinals', 1992, 1997).catch(console.log).then(data => {
  data = data.map((obj) => {
    //grab just the date and attendance
    obj.games = obj.games.map((g) => [g.date, g.attendance])
    return obj
  })
  console.log(JSON.stringify(data, null, 2))
})

(work-in-progress)

MIT

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.2.1

5 years ago

0.2.0

6 years ago

0.0.1

6 years ago