Comments (4)
I was having the same problem and had a quick look at the code. Looks like the problem is coming from a new default argument (params = list()
) that was added to the .nba_headers()
function. That function uses httr::GET
to request the data from the API. The params
argument is passed to httr::GET in the query
argument but it is empty for the nba_leaguegamelog
function. If you remove the query
argument the data is returned as it was before.
So if this:
res <- httr::RETRY("GET", url, query = params, httr::add_headers(.headers = headers))
is changed to this:
if(length(params) == 0) {
res <- httr::RETRY("GET", url, httr::add_headers(.headers = headers))
} else {
res <- httr::RETRY("GET", url, query = params, httr::add_headers(.headers = headers))
}
in the .nba_headers()
function, everything works. The params
argument gets used elsewhere (e.g. hoopR::nba_scoreboard
. so you need some logic to deal with the case where params are empty
from hoopr.
It looks like when I ran on Windows (where it was working), I was using version 1.5.0 of hoopR. When I switched to 1.8.0, I got the same error message as when running on Mac. And when I switched back to 1.5.0 on the Mac, the function worked. So it seems like the function works in v. 1.5.0, but was having some issues with 1.7.0 and then also when I updated to 1.8.0.
Thanks.
from hoopr.
You're a lifesaver, thanks
from hoopr.
No problem! Anytime
from hoopr.
Related Issues (20)
- Missing games for 2023 box scores HOT 3
- load_mbb_player_box returning team box scores for 2023 season HOT 2
- most_recent_nba_season() (2024) not found HOT 5
- nba_scoreboard not updating in real-time HOT 1
- Error downloading current season data, schedule HOT 6
- hoopR::load_mbb_schedule(2024:2024) resturning zero records HOT 11
- All NCAA 2024 season request come back with errors HOT 6
- kp_team_players does not return data for 2024. HOT 5
- Incorrect/Mismatched Game IDs in NBA API functions HOT 1
- espn_mbb_betting(game_id) does not return values for 2024 season HOT 3
- NBA pbp missing early October games from 2002 - 2007
- Unusual Behavior with kp_gameplan for 2024
- kp_team_schedules not working as intended for 2024 HOT 1
- Incorrect spreads for 2024 NBA games from load_nba_pbp() HOT 1
- Using Posit Cloud with hoopR - having issues HOT 5
- kp_team_history() not functioning HOT 1
- espn_mbb_teams only returns 358 of 362 teams
- load_nba_team_box() , schedule and pbp are missing 14th of march games HOT 2
- Erroneous play by play data
- Culmulative nba_teamestimatedmetrics()
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hoopr.