sportsdataverse / fastRhockey

Boxscore and play-by-play stat scraper for the Premier Hockey Federation (PHF, formerly known as the NWHL).
https://fastRhockey.sportsdataverse.org
Other
21 stars 3 forks source link

Question about the URL request #39

Open dannypage opened 5 months ago

dannypage commented 5 months ago

Curious why this line is needed in the code - or more broadly, why there's a Callback at the end of the base_url? It seems to work without the callback, but maybe there's some information I am missing.

I'm also curious about the key and if we should be concerned about it ever rotating. Thanks!

https://github.com/sportsdataverse/fastRhockey/blob/12ff24b40a665c6b47bcfb757e207ecec22d3eff/R/pwhl_teams.R#L28

benhowell71 commented 5 months ago

Yeah, as I'm going back and updating / re-writing some of the functions, I am converting them to this to handle the regex better:

  callback_pattern <- "angular.callbacks._\\d+\\("
  res <- gsub(callback_pattern, "", res)