whatadewitt / yahoo-fantasy-sports-api

NodeJS wrapper for the Yahoo! Fantasy Sports API
https://yahoo-fantasy-node-docs.vercel.app/
MIT License
192 stars 52 forks source link

Allow fetching weekly stats/points for players in a league context #28

Closed kmudrick closed 4 years ago

kmudrick commented 7 years ago

If you are curious on the use case: I'm in a (football) league where we do additional prizes based on the team with the best offense and the team with the best defense - so I am literally looping through every week of the season (since American football operates on a 'weekly' schedule), for every team in this league, and getting the individual points for each player that started at an offensive position ('WR', 'W/R/T', 'TE', 'RB', 'QB', 'K') and the points for every player/team that started at a defensive position ('CB', 'DE', 'S', 'LB', 'DT', 'DEF', 'D') to compute that.

whatadewitt commented 7 years ago

... I'm going over this more and more and it almost looks like the exact solution that I was looking for for the "league.players" resource... do you mind if I take some small liberties with the code...

whatadewitt commented 7 years ago

Any chance I could ask you for your league ID and/or whether you can make it public so I can test the calls versus it? I only have MLB/NHL leagues that I can test against... and I want to see what I can actually get back as MLB has me pretty limited...

whatadewitt commented 7 years ago

I've been looking at this, and while it is causing a couple of smaller issues, I can easily work around that... what I'm more curious about is how you found this? I don't see it anywhere in the documentation that you can "chain" like this...

whatadewitt commented 4 years ago

... so... there was a bunch of stuff I didn't understand when you submitted this, and for that I apologize. I just pushed 3.2.0 which has this functionality in it. I wish I had taken some more time to go over this when you submitted it and wanted to thank you, immensely, for your time doing it!!