Code Monkey home page Code Monkey logo

Comments (11)

kashav avatar kashav commented on May 30, 2024 2

Hey @jordzhu, thanks for the issue!

So I've briefly described how each method works here. It might be kind of confusing though, so I'll try to re-explain.

Each method takes 2 optional arguments – query and cb. The first argument is the one that should contain the URL/request parameters (i.e. year for this method).

nba.data.team({  year: '2016' }, function(err, res) {
  if (err) {
    console.error(err);
    return;
  }
  console.log(res);
});

The documentation for data endpoint parameters is incomplete right now, so if you're looking for some sort of specification for a parameter, feel free to ask away (most should be intuitive). It'll be updated very soon.

from nba.js.

sharpar avatar sharpar commented on May 30, 2024 1

The example you gave definitely helped. Looking forward to future updates, I think some more documentation will be very helpful. Either way great job man!

from nba.js.

jordzhu avatar jordzhu commented on May 30, 2024 1

Thanks dude! This helped a lot, I agree with sharpar :)

from nba.js.

kashav avatar kashav commented on May 30, 2024 1

@WataruKay Awesome! And sure, let me merge that right now. Also note that I've changed a few of the parameter names (including teamUrlCode), refer to 88c7d76 for more info.

from nba.js.

kashav avatar kashav commented on May 30, 2024

There are a few examples here, but it isn't as comprehensive as it should/can be 😅. That'll be updated very soon as well.

from nba.js.

sharpar avatar sharpar commented on May 30, 2024

I'm not sure if I'm doing something wrong or not, but when I call currentScoreboard, it doesn't show the current scores.

nba.data.currentScoreboard(function(err, res) {
    if (err) {
        console.error(err);
        return;
    }
    console.log(res);
});

Output:

{ games: [], numGames: 0 }

Also for scoreboard, what format is the date parameter supposed to be in?

from nba.js.

TikiCat7 avatar TikiCat7 commented on May 30, 2024

For scoreboard the date format is 'yyyy-mm-dd' so something like 20161027.
As for the currentScoreboard endpoint it doesn't seem to be working.

from nba.js.

kashav avatar kashav commented on May 30, 2024

@sharpar Yeah, looks like the currentScoreboard endpoint is returning nothing right now. I'm not entirely sure that this ever worked (might've just assumed it does, since it doesn't error out), going to keep it around for the time being.

@WataruKay is right about the date format, should be of the form "yyyymmdd".

from nba.js.

kashav avatar kashav commented on May 30, 2024

Got a PR in the works (#11) for the data parameter references.

Should be merged soon (missing some information for teamUrlCode / seasonScheduleYear right now, would love some help 😄).

from nba.js.

TikiCat7 avatar TikiCat7 commented on May 30, 2024

I just got all the teamurls valid for endpoints that use teamUrlCode
'hawks', 'fcbarcelona', 'celtics', 'nets', 'san_lorenzo', 'hornets', 'bulls', 'cavaliers', 'mavericks', 'nuggets', 'pistons', 'warriors', 'maccabi_haifa', 'rockets', 'pacers', 'clippers', 'lakers', 'grizzlies', 'heat', 'bucks', 'timberwolves', 'pelicans', 'knicks', 'thunder', 'magic', 'sixers', 'suns', 'blazers', 'real_madrid', 'kings', 'spurs', 'shanghai_sharks', 'raptors', 'jazz', 'wizards'

Should I wait for #11 to be merged then make a new pull request?

from nba.js.

TikiCat7 avatar TikiCat7 commented on May 30, 2024

I've submitted #12 with the 'teamName' values.

from nba.js.

Related Issues (14)

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.