Code Monkey home page Code Monkey logo

nhlplaybyplay-node's Introduction

Please use latest version

alt tag

nhlplaybyplay-node

Fetch and Convert NHL Play by Play game data

Purpose

Application built using Node.js that provides the means for accessing, fetching NHL Schedule and Play by Play game data in JSON format and converting the output to CSV.

Hope your familiar with this…

2016-2017 NHL Season Schedule -> http://live.nhl.com/GameData/SeasonSchedule-20162017.json

Play by Play for game 2016020031 -> http://live.nhl.com/GameData/20162017/2016020031/PlayByPlay.json

Note: Schedule and Play by Play data only available from the 2011-2012 NHL Season and onward…

Installation

Install the dependencies with the following command:

npm install

Create a data directory:

mkdir data

Before using you will need to create a specific directory for each of the seasons you will be fetching data for.

i.e. To fetch data from the 2012-2013 NHL season you need to create the following folder 20122013 under the data directory.

Usage

Fetch Play by Play JSON
node fetch.js season [game]

To fetch all games for a specific season:

node fetch.js 20152016

To fetch a specific game from a specific season

node fetch.js 20162017 2016020001

Convert Play by Play JSON to CSV
node convert.js season [game]

To convert all games for a specific season:

node convert.js 20152016

To convert a specific game from a specific season

node convert.js 20162017 2016020001

nhlplaybyplay-node's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nhlplaybyplay-node's Issues

Resolving Play-By-Play with Game Feed

Hello! I found this project through your blog post (which I found via Google!) while trying to resolve a question I have about the NHL Stats API. I am wondering whether you have any idea what is at work here...

As far I can tell, there are two separate API endpoints which contain play-by-play data. The first is the one you highlighted in this project, which looks like: http://live.nhl.com/GameData/20162017/2016020471/PlayByPlay.json. The other feed powers the "ice tracker" view that is part rink-graphic, part boxscore; https://statsapi.web.nhl.com/api/v1/game/2016020471/feed/live. Comparing the two, two things are immediately evident to me:

  1. The latter /feed/live returns many more events in total. Some of those events are relatively useless (I've seen "Period End" followed by a new event, "Official Period End"), but nonetheless there are one the order of three times as many events in total as there are in the first feed.
  2. The /feed/live does NOT include data about which players were on the ice (but not directly involved in the play) for each play.

At some point in the near future, I'll investigate further and put together a better comparison. I am just wondering whether you have seen this alternative feed and/or have any thoughts about how complete this project's current endpoint is!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.