cfb-data icon indicating copy to clipboard operation
cfb-data copied to clipboard

What is the significance of "groups" parameter?

Open kajensen opened this issue 7 years ago • 9 comments

> groups: 80, // all FBS games

What does this mean?

Also, getTeamList requires this "groups" input. Might want to update the readme.

kajensen avatar Aug 29 '18 22:08 kajensen

ESPN (the main source for the data) has a groups param with an id. 80 represents all of FBS, but other values can be used for individual conferences. All functions have been updated such that this parameter is now optional and should now default to all of FBS.

BlueSCar avatar Sep 24 '18 04:09 BlueSCar

TypeError: Cannot destructure property groups of 'undefined' or 'null'.

I am getting this when I try to run in RunKit just to test some things.

var cfbData = require("cfb-data")

const results = await cfbData.teams.getTeamList();

ferociouskyle avatar Oct 16 '18 15:10 ferociouskyle

@ferociouskyle you need to supply {groups: 80} as "inputs" for getTeamList()

kajensen avatar Oct 16 '18 15:10 kajensen

@ferociouskyle you need to supply {groups: 80} as "inputs" for getTeamList()

I am stupid! Thanks :)

ferociouskyle avatar Oct 16 '18 15:10 ferociouskyle

const inputs = { groups: 80 };

const results = await cfbData.teams.getTeamList(inputs);

kajensen avatar Oct 16 '18 15:10 kajensen

Yeah, it should be optional. Re-opening the issue. Should be an easy fix.

BlueSCar avatar Oct 16 '18 15:10 BlueSCar

Came here to bring up something I found regarding the group parameter in the package, but guess I'll just drop it here since you're already looking at it.

It looks like ESPN has changed their accepted query params with regards to 'groups' vs. 'group'. At least as it pertains to schedules, if you use the plural 'groups', the group filter doesn't work at all and you'll get all FBS results.

blakep2012 avatar Aug 25 '19 23:08 blakep2012

@blakep2012 https://github.com/BlueSCar/cfb-data/blob/master/app/services/schedule.service.js does already use "group" instead of "groups"

"groups" is used for other endpoints. I don't think anything has changed (since last year at least).

kajensen avatar Aug 26 '19 15:08 kajensen

@kajensen yeah, that is fixed from my PR that had just gone through. It's all working now.

blakep2012 avatar Aug 29 '19 17:08 blakep2012