spencermountain / wtf-plugin-nhl

parse NHL data from wikipedia

Home Page:https://observablehq.com/@spencermountain/wtf-plugin-nhl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Heads-up

This plugin has moved to → wtf_wikipedia/plugins/sports

this repo is now deprecated.

a plugin for wtf_wikipedia

npm install wtf-plugin-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.

const plugin = require('wtf-plugin-nhl')
wtf.extend(plugin)
wtf.getSeason('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
    },
    ...
  ],
}*/
})

See also:

MIT

About

parse NHL data from wikipedia

https://observablehq.com/@spencermountain/wtf-plugin-nhl


Languages

Language:JavaScript 100.0%