sportsdataverse / sportsdataverse-js

Retrieves sports data from a popular sports website as well as from the NCAA website, with support for NBA, WNBA, NFL, NHL, College Football and mens and womens college basketball,
https://js.sportsdataverse.org
49 stars 12 forks source link

added `getWeeklySchedule(week, year, seasonType)` to NFL service #20

Closed unmonk closed 1 year ago

unmonk commented 1 year ago

My brother asked for a pickem league, the current nfl.getSchedule fetches by year, month, day. Which could work, but wasnt the easiest solution for me.

getWeeklySchedule(week, year, seasonType) is just utilizing some different params on that same cdn http://cdn.espn.com/core/nfl/schedule/_/week/${week}/year/${year}/seasontype/${seasonType}`;

Defaults to 1st week of regular season, of current year, if no parameters are provided.

Related tests created. Ran md-nfl and readme

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sportsdataverse-js ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 20, 2023 8:07pm
saiemgilani commented 1 year ago

Sounds good. And this is no problem, but whatever nfl schedule function was there could've also just accepted date=year and a week parameter. Merge as you want, make the version/changelog updates, then run the publish action

unmonk commented 1 year ago

Hmm that could be a possibility as well.

I'm actually looking at doing a typescript fork soon, which I am hoping to overhaul how params are handled.

How are you handling the version bump? I dont think I see it as part of the publish workflow.

Looks like just a manual bump and commit.