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

Hardcoded ticket authorization could be a failure point #3

Closed tanho63 closed 2 years ago

tanho63 commented 2 years ago

https://github.com/benhowell71/whockeyR/blob/34a087b20bf4f1ec1af542b0a1af5b4a495885a5/R/pbp_functions.R#L33

Unsure how the API is maintained but I suspect these tickets may only last a certain length of time (30 days? one week? worse?)

Suggest making this a package option and setting this as the default if not set by the option, that'll make it nicer to maintain.

something like

auth_ticket <- getOption(
  "whockeyR.phf_ticket", 
  default = 'ticket="4dM1QOOKk-PQTSZxW_zfXnOgbh80dOGK6eUb_MaSl7nUN0_k4LxLMvZyeaYGXQuLyWBOQhY8Q65k6_uwMu6oojuO'
)

then using that variable in your header