项目作者: BlueSCar

项目描述 :
NPM package for retrieving NCAA football data
高级语言: JavaScript
项目地址: git://github.com/BlueSCar/cfb-data.git
创建时间: 2016-08-21T01:27:08Z
项目社区:https://github.com/BlueSCar/cfb-data

开源协议:

下载


Update (2.0.0): Every function now returns a promise. Existing functionality should still be preserved, so it is safe to update from previous versions without making any changes.

cfb-data

  • currently supports retrieving the following types of data:
    • detailed play-by-play
    • scores
    • standings
    • rankings
  • investigating future support for other types of data
    • team statistics
    • individual statistics

contents

  1. install
  2. use

    a. games

    b. scores

    c. schedules

    d. conferences

    e. teams

    f. rankings

    g. standings

    h. recruiting

  3. license

install

  1. npm install cfb-data

use

  1. const cfb = require('cfb-data');

games

  1. const gameId = 400763535;
  2. // get detailed play-by-play data for a game
  3. const result = await cfb.games.getPlayByPlay(gameId);
  4. // get box score
  5. const result = await cfb.games.getBoxScore(id);
  6. // get game all game data
  7. const summary = await cfb.games.getSummary(gameId);

scores

  1. // get scoreboard data
  2. const inputs = {
  3. year: 2015,
  4. week: 5
  5. };
  6. const result = await cfb.scoreboard.getScoreboard(inputs);

schedules

  1. const inputs = {
  2. groups: 80, // all FBS games
  3. year: 2017,
  4. week: 8
  5. };
  6. const result = await cfb.schedule.getSchedule(inputs);

conferences

  1. const results = await cfb.scoreboard.getConferences();

teams

  1. // get list of teams
  2. const result = await cfb.teams.getTeamList();
  3. // get individual team data
  4. const teamId = 130;
  5. const result = await cfb.teams.getTeamInfo(teamId);
  6. // get team roster data
  7. const result = await cfb.teams.getTeamPlayers(teamId);

rankings

  1. // get rankings
  2. const inputs = {
  3. year: 2015,
  4. week: 10
  5. };
  6. const result = await cfb.rankings.getRankings(inputs);

standings

  1. // get standings
  2. const inputs = {
  3. year: 2015
  4. };
  5. const result = await cfb.standings.getStandings(inputs);

recruiting

  1. // get recruiting data from 247Composite
  2. // get player rankings
  3. const result = await cfb.recruiting.getPlayerRankings({
  4. year: 2016
  5. });
  6. const result = await cfb.recruiting.getPlayerRankings({
  7. year: 2016,
  8. position: "DT"
  9. });
  10. const result = await cfb.recruiting.getPlayerRankings({
  11. year: 2016,
  12. group: "JuniorCollege"
  13. });
  14. // get school rankings
  15. const result = await cfb.recruiting.getSchoolRankings(2016);
  16. // get a school's commit list
  17. const result = await cfb.recruiting.getSchoolCommits('michigan', 2016);

license

MIT