Skip to content

Commit

Permalink
Update espn base url
Browse files Browse the repository at this point in the history
  • Loading branch information
tanho63 authored May 29, 2024
1 parent a9c35cb commit 2f9dff5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/espn_api.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ espn_getendpoint <- function(conn, ..., x_fantasy_filter = NULL) {

if (as.numeric(conn$season) < 2018) {
url_query <- httr::modify_url(
url = glue::glue("https://fantasy.espn.com/apis/v3/games/ffl/leagueHistory/{conn$league_id}?seasonId={conn$season}"),
url = glue::glue("https://lm-api-reads.fantasy.espn.com/apis/v3/games/ffl/leagueHistory/{conn$league_id}?seasonId={conn$season}"),
query = list(...)
)
}

if (as.numeric(conn$season) >= 2018) {
url_query <- httr::modify_url(
url = glue::glue("https://fantasy.espn.com/apis/v3/games/ffl/seasons/{conn$season}/segments/0/leagues/{conn$league_id}"),
url = glue::glue("https://lm-api-reads.fantasy.espn.com/apis/v3/games/ffl/seasons/{conn$season}/segments/0/leagues/{conn$league_id}"),
query = list(...)
)
}
Expand Down

0 comments on commit 2f9dff5

Please sign in to comment.