Code Monkey home page Code Monkey logo

nba.js's Introduction

nba.js

npm version Build Status Coverage Status Dependency Status code style: prettier

A Node.js library for current and historical NBA stats, scores, and data.

Table of contents

Full documentation and usage guide can be found here.

Installation

Install via npm.

$ npm install --save nba.js

Usage

Examples

See EXAMPLES.md.

Contribute

This project is completely open source. Feel free to open an issue or make a pull request.

For more information, see CONTRIBUTING.md.

License

MIT © Kashav Madan.

nba.js's People

Contributors

brianwalborn avatar jbkuczma avatar kashav avatar malikwas avatar mihaisavezi avatar

Stargazers

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

Watchers

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

nba.js's Issues

Unhandled promise rejection warning

Since nba.js allows you to choose between using Promises and callbacks to handle responses, when using a callback, if there's an error, Node throws a warning for unhandled Promises rejections.

Would be great if this could be resolved, I'll update this thread as I come up with possible solutions, input/ideas welcome.

Implement new endpoints

So it looks like there are some new endpoints available (not entirely sure that these are new, might've just not noticed them earlier) endpoints.

The problem is, the current structure (of this module) only focuses on stats.nba.com endpoints. This means the current endpoint worker is specialized for the data returned from those endpoints. So this means we'll either have to reimplement the current worker or implement a new one.

Also, it'd be best to separate the stats endpoints (i.e. all that are currently implemented) from the new ones.

Requests to the stats endpoints are timing out/hanging

Requests to the stats endpoints seem to be timing out on specific servers. Tested on a Digital Ocean instance, request does resolve, but takes significantly longer (as expected, kind of at least), can see why this is a problem for slower connections.

Would love some input on how to fix this, current course of action is to investigate/research this a little bit more, got has a timeout option that might help with this.

Originally reported on Twitter by Justin Conklin.

This working now?

Wonder if this is working in 2020. I have tried acessing the endpoint without luck.

Time error

period_status == Final but game_clock != "". (see image)

screen shot 2015-12-31 at 8 25 00 pm

Probably due to delay in update time by NBA. Choose time status (thing in brackets) based on period_status rather than game_clock.

Endpoint tests

Tests should be more exhaustive, particularly for the endpoint methods. They're currently not tested at all (individually), but probably should be.

I'm thinking most could be kept to 2 tests - one with the preset defaults and another with custom query options. In the case that there's an exception for a given method (unique defaults, etc.), there should be some more specific tests.

Is BoxScoreAdvancedV2 updated in real time?

I was thinking about polling this particular endpoint instead of "playercareerstats" because it gets updated after the game ends. I need real time data to get Player points in real time.

10s purpose in API base URL

Base URL of the api is : http://data.nba.net/10s/prod/v1/

Could someone explain me what is that "10s" purpose?

I first thought it means "the 2010s", but if it is the case, that would mean the base url will change during the "2020-2021" season.

I am developing a mobile application with that API, and I would like to avoid any risks.

Thank you!

Endpoints for optional date parameters

Hey all,

Currently in DATA.md, there are a list of endpoints with current set as the date in the URL. For example:

So, I wanted to see if I could get division standings for any random date during the season, such as March 3, 2017. Turns out it actually does return a response for that exact date.

Should the endpoints and docs be edited in the library to show this? I think this works for all current instances in the URL, where we can replace it with YYYYMMDD. What's the best way to make this change, then?

Parameters

What would an example of using parameters look like? I'm just not really understanding the syntax (for example, the teams method has the parameter year)

Thanks!

Use superagent to make requests

I think we can refactor how requests are made (data, stats) to provide browser support for this package. It looks like superagent supports both browserify and webpack, which'll allow us to bundle this into a browser library (please correct me if I'm mistaken, or if this is possible with got as well).

Will look into this a bit more and see what can be done.

Required parameters

Find the required parameters for each of the nba.stats endpoints and make that parameter bold.

Most stats.nba.com endpoints will throw an error if a required parameter is missing, so we can use this to find the list of required params.


e.g. Making a request to http://stats.nba.com/stats/commonallplayers without any parameters will return:

LeagueID is required; Season is required; IsOnlyCurrentSeason is required

So the documentation for the data.stats.allPlayers method should look like:

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.