jthomasmock / espnscrapeR

Scrapes Or Collects NFL Data From ESPN
https://jthomasmock.github.io/espnscrapeR/
Other
51 stars 10 forks source link

get_college_qbr() only pulling 2020 data #14

Closed JerrickBackous closed 3 years ago

JerrickBackous commented 3 years ago

Hi Tom,

Thanks for updating the package, and it's working great for 2020, but the 2020 season is the only data I can pull. If I'm reading it right, it looks like 2020 is hardcoded into the function here:

image

Thanks!

jthomasmock commented 3 years ago

You are correct in that 2020 was hard-coded, but inside the function.

code inside function(season = 2020, ...) sets the "default" value so you can call get_college_qbr() and it would return 2020's data.

I've corrected the internals (had duplicated httr::GET()) so that it will reflect specific years again.

Thanks for the bug report!

jthomasmock commented 3 years ago

ESPN's API endpoint is not playing nicely 😢

Diagnosing the correct "seasonType" which should be 2 or 3, but is only returning either season level or bowls.

jthomasmock commented 3 years ago

So apparently ESPN has removed all weekly college QBR data from prior to 2020.

I'll continue looking but it may just not be available. 😭

It's not even available on the basic webpage:

https://www.espn.com/college-football/qbr/_/view/weekly/season/2019/week/3

jthomasmock commented 3 years ago

Ok - I have fixed this now @JerrickBackous - ESPN altered the college API to return ALL weeks paginated. So now the function takes a bit longer but does return a whole season of weekly data at once as far as I can tell (approx 1600 obs/year).

jthomasmock commented 3 years ago

I have confirmed weekly data going back to 2004 note that the latest package version is 0.5.1 and uses the syntax below:

espnscrapeR::get_college_qbr(2018, type = "weekly") - feel free to give it a try, but I'll also be uploading raw data to a central repo in the future.

wk-years

jthomasmock commented 3 years ago

Closing this as it is working again but please let me know if you have any issues @JerrickBackous