diff --git a/README.Rmd b/README.Rmd index dfc0888f..fad4dd95 100644 --- a/README.Rmd +++ b/README.Rmd @@ -23,10 +23,10 @@ eval <- TRUE tryCatch(expr = { - download.file("https://github.com/ffverse/ffscrapr-tests/archive/main.zip","f.zip") + download.file("https://github.com/ffverse/ffscrapr-tests/archive/1.4.7.zip","f.zip") unzip('f.zip', exdir = ".") - httptest::.mockPaths(new = "ffscrapr-tests-main")}, + httptest::.mockPaths(new = "ffscrapr-tests-1.4.7")}, warning = function(e) eval <<- FALSE, error = function(e) eval <<- FALSE) @@ -42,7 +42,7 @@ httptest::use_mock_api() [![CRAN status](https://img.shields.io/cran/v/ffscrapr?style=flat-square&logo=R&label=CRAN)](https://CRAN.R-project.org/package=ffscrapr) [![Dev status](https://img.shields.io/github/r-package/v/ffverse/ffscrapr/dev?label=dev&style=flat-square&logo=github)](https://ffscrapr.ffverse.com/dev/) [![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-green.svg?style=flat-square)](https://lifecycle.r-lib.org/articles/stages.html) -[![Codecov test coverage](https://img.shields.io/codecov/c/github/ffverse/ffscrapr?label=codecov&style=flat-square&logo=codecov)](https://codecov.io/gh/ffverse/ffscrapr?branch=main) +[![Codecov test coverage](https://img.shields.io/codecov/c/github/ffverse/ffscrapr?label=codecov&style=flat-square&logo=codecov)](https://app.codecov.io/gh/ffverse/ffscrapr?branch=main) [![R build status](https://img.shields.io/github/workflow/status/ffverse/ffscrapr/R-CMD-check?label=R%20check&style=flat-square&logo=github)](https://github.com/ffverse/ffscrapr/actions) [![API status](https://img.shields.io/github/workflow/status/ffverse/ffscrapr/Test%20APIs?label=API%20check&style=flat-square&logo=github)](https://github.com/ffverse/ffscrapr/actions) [![nflverse discord](https://img.shields.io/discord/789805604076126219?color=7289da&label=nflverse%20discord&logo=discord&logoColor=fff&style=flat-square)](https://discord.com/invite/5Er2FBnnQa) @@ -120,5 +120,5 @@ The APIs and data accessed by this package belong to their respective owners, an ```{r include = FALSE} httptest::stop_mocking() -unlink(c("ffscrapr-tests-main","f.zip"), recursive = TRUE, force = TRUE) +unlink(c("ffscrapr-tests-1.4.7","f.zip"), recursive = TRUE, force = TRUE) ``` diff --git a/README.md b/README.md index 66190ba1..412e3613 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ status](https://img.shields.io/github/r-package/v/ffverse/ffscrapr/dev?label=dev [![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-green.svg?style=flat-square)](https://lifecycle.r-lib.org/articles/stages.html) [![Codecov test -coverage](https://img.shields.io/codecov/c/github/ffverse/ffscrapr?label=codecov&style=flat-square&logo=codecov)](https://codecov.io/gh/ffverse/ffscrapr?branch=main) +coverage](https://img.shields.io/codecov/c/github/ffverse/ffscrapr?label=codecov&style=flat-square&logo=codecov)](https://app.codecov.io/gh/ffverse/ffscrapr?branch=main) [![R build status](https://img.shields.io/github/workflow/status/ffverse/ffscrapr/R-CMD-check?label=R%20check&style=flat-square&logo=github)](https://github.com/ffverse/ffscrapr/actions) [![API @@ -62,51 +62,12 @@ ssb <- ff_connect(platform = "mfl", league_id = "54040", season = 2020) # Get a summary of league settings ff_league(ssb) %>% str() -#> tibble [1 x 17] (S3: tbl_df/tbl/data.frame) -#> $ league_id : chr "54040" -#> $ league_name : chr "The Super Smash Bros Dynasty League" -#> $ season : int 2020 -#> $ league_type : chr NA -#> $ franchise_count : num 14 -#> $ qb_type : chr "1QB" -#> $ idp : logi FALSE -#> $ scoring_flags : chr "0.5_ppr, TEPrem, PP1D" -#> $ best_ball : logi FALSE -#> $ salary_cap : logi FALSE -#> $ player_copies : num 1 -#> $ years_active : chr "2018-2021" -#> $ qb_count : chr "1" -#> $ roster_size : num 33 -#> $ league_depth : num 462 -#> $ draft_type : chr "email draft" -#> $ draft_player_pool: chr "Both" # Get rosters ff_rosters(ssb) -#> # A tibble: 442 x 11 -#> franchise_id franchise_name player_id player_name pos team age -#> <chr> <chr> <chr> <chr> <chr> <chr> <dbl> -#> 1 0001 Team Pikachu 13189 Engram, Evan TE NYG 27 -#> 2 0001 Team Pikachu 11680 Landry, Jarvis WR CLE 28.8 -#> 3 0001 Team Pikachu 13645 Smith, Tre'Quan WR NOS 25.7 -#> 4 0001 Team Pikachu 12110 Brate, Cameron TE TBB 30.2 -#> 5 0001 Team Pikachu 13168 Reynolds, Josh WR LAR 26.5 -#> # ... with 437 more rows, and 4 more variables: roster_status <chr>, -#> # drafted <chr>, draft_year <chr>, draft_round <chr> # Get transactions ff_transactions(ssb) -#> # A tibble: 1,145 x 12 -#> timestamp type type_desc franchise_id franchise_name -#> <dttm> <chr> <chr> <chr> <chr> -#> 1 2021-02-12 14:32:39 TRADE traded_away 0008 Team Bowser -#> 2 2021-02-12 14:32:39 TRADE traded_for 0008 Team Bowser -#> 3 2021-02-12 14:32:39 TRADE traded_for 0008 Team Bowser -#> 4 2021-02-12 14:32:39 TRADE traded_for 0008 Team Bowser -#> 5 2021-02-12 14:32:39 TRADE traded_for 0008 Team Bowser -#> # ... with 1,140 more rows, and 7 more variables: player_id <chr>, -#> # player_name <chr>, pos <chr>, team <chr>, bbid_spent <dbl>, -#> # trade_partner <chr>, comments <chr> ``` Platform-specific guides on getting started with ffscrapr are here: diff --git a/tests/testthat/setup.R b/tests/testthat/setup.R index 69f76b80..7b626bda 100644 --- a/tests/testthat/setup.R +++ b/tests/testthat/setup.R @@ -15,13 +15,13 @@ skip <- FALSE if (download_mock) { tryCatch( expr = { - download.file("https://github.com/ffverse/ffscrapr-tests/archive/main.zip", "f.zip") + download.file("https://github.com/ffverse/ffscrapr-tests/archive/1.4.7.zip", "f.zip") unzip("f.zip", exdir = ".") - httptest::.mockPaths(new = "ffscrapr-tests-main") + httptest::.mockPaths(new = "ffscrapr-tests-1.4.7") withr::defer( - unlink(c("ffscrapr-tests-main", "f.zip"), recursive = TRUE, force = TRUE), + unlink(c("ffscrapr-tests-1.4.7", "f.zip"), recursive = TRUE, force = TRUE), testthat::teardown_env() ) }, diff --git a/tests/testthat/test-ff_scoringhistory.R b/tests/testthat/test-ff_scoringhistory.R index 702a7a59..24adaccb 100644 --- a/tests/testthat/test-ff_scoringhistory.R +++ b/tests/testthat/test-ff_scoringhistory.R @@ -5,11 +5,11 @@ with_mock_api({ if (!identical(Sys.getenv("MOCK_BYPASS"), "true")) { testthat::local_mock( nflfastr_weekly = function(seasons, type) { - if(type == "offense") return(readRDS("ffscrapr-tests-main/gh_nflfastr/player_stats.rds")) - if(type == "kicking") return(readRDS("ffscrapr-tests-main/gh_nflfastr/kicker_stats.rds")) + if(type == "offense") return(readRDS("ffscrapr-tests-1.4.7/gh_nflfastr/player_stats.rds")) + if(type == "kicking") return(readRDS("ffscrapr-tests-1.4.7/gh_nflfastr/kicker_stats.rds")) }, nflfastr_rosters = function(seasons) { - purrr::map_df(seasons, ~ readRDS(glue::glue("ffscrapr-tests-main/gh_nflfastr/roster_{.x}.rds"))) + purrr::map_df(seasons, ~ readRDS(glue::glue("ffscrapr-tests-1.4.7/gh_nflfastr/roster_{.x}.rds"))) } ) } diff --git a/vignettes/espn_basics.Rmd b/vignettes/espn_basics.Rmd index cc9ec70b..03c95120 100644 --- a/vignettes/espn_basics.Rmd +++ b/vignettes/espn_basics.Rmd @@ -22,10 +22,10 @@ eval <- TRUE tryCatch(expr = { - download.file("https://github.com/ffverse/ffscrapr-tests/archive/main.zip","f.zip") + download.file("https://github.com/ffverse/ffscrapr-tests/archive/1.4.7.zip","f.zip") unzip('f.zip', exdir = ".") - httptest::.mockPaths(new = "ffscrapr-tests-main")}, + httptest::.mockPaths(new = "ffscrapr-tests-1.4.7")}, warning = function(e) eval <<- FALSE, error = function(e) eval <<- FALSE) @@ -160,6 +160,6 @@ In this vignette, I've used only a few functions: ff_connect, ff_league, ff_rost ```{r include = FALSE} httptest::stop_mocking() -unlink(c("ffscrapr-tests-main","f.zip"), recursive = TRUE, force = TRUE) +unlink(c("ffscrapr-tests-1.4.7","f.zip"), recursive = TRUE, force = TRUE) ``` diff --git a/vignettes/espn_getendpoint.Rmd b/vignettes/espn_getendpoint.Rmd index d6f69329..9f381f21 100644 --- a/vignettes/espn_getendpoint.Rmd +++ b/vignettes/espn_getendpoint.Rmd @@ -22,10 +22,10 @@ eval <- TRUE tryCatch(expr = { - download.file("https://github.com/ffverse/ffscrapr-tests/archive/main.zip","f.zip") + download.file("https://github.com/ffverse/ffscrapr-tests/archive/1.4.7.zip","f.zip") unzip('f.zip', exdir = ".") - httptest::.mockPaths(new = "ffscrapr-tests-main")}, + httptest::.mockPaths(new = "ffscrapr-tests-1.4.7")}, warning = function(e) eval <<- FALSE, error = function(e) eval <<- FALSE) @@ -155,5 +155,5 @@ Many of the API endpoints are being researched in other languages and you might ```{r include = FALSE} httptest::stop_mocking() -unlink(c("ffscrapr-tests-main","f.zip"), recursive = TRUE, force = TRUE) +unlink(c("ffscrapr-tests-1.4.7","f.zip"), recursive = TRUE, force = TRUE) ``` diff --git a/vignettes/fleaflicker_basics.Rmd b/vignettes/fleaflicker_basics.Rmd index 19ec1175..2e76272e 100644 --- a/vignettes/fleaflicker_basics.Rmd +++ b/vignettes/fleaflicker_basics.Rmd @@ -23,10 +23,10 @@ eval <- TRUE tryCatch(expr = { - download.file("https://github.com/ffverse/ffscrapr-tests/archive/main.zip","f.zip") + download.file("https://github.com/ffverse/ffscrapr-tests/archive/1.4.7.zip","f.zip") unzip('f.zip', exdir = ".") - httptest::.mockPaths(new = "ffscrapr-tests-main")}, + httptest::.mockPaths(new = "ffscrapr-tests-1.4.7")}, warning = function(e) eval <<- FALSE, error = function(e) eval <<- FALSE) @@ -162,6 +162,6 @@ In this vignette, I've used only a few functions: ff_connect, ff_league, ff_rost ```{r include = FALSE} httptest::stop_mocking() -unlink(c("ffscrapr-tests-main","f.zip"), recursive = TRUE, force = TRUE) +unlink(c("ffscrapr-tests-1.4.7","f.zip"), recursive = TRUE, force = TRUE) ``` diff --git a/vignettes/fleaflicker_getendpoint.Rmd b/vignettes/fleaflicker_getendpoint.Rmd index 2a1a65d6..b4dabb1e 100644 --- a/vignettes/fleaflicker_getendpoint.Rmd +++ b/vignettes/fleaflicker_getendpoint.Rmd @@ -22,10 +22,10 @@ eval <- TRUE tryCatch(expr = { - download.file("https://github.com/ffverse/ffscrapr-tests/archive/main.zip","f.zip") + download.file("https://github.com/ffverse/ffscrapr-tests/archive/1.4.7.zip","f.zip") unzip('f.zip', exdir = ".") - httptest::.mockPaths(new = "ffscrapr-tests-main")}, + httptest::.mockPaths(new = "ffscrapr-tests-1.4.7")}, warning = function(e) eval <<- FALSE, error = function(e) eval <<- FALSE) @@ -123,6 +123,6 @@ From here, you can keep unravelling - including the "viewingActualPoints" and "v ```{r include = FALSE} httptest::stop_mocking() -unlink(c("ffscrapr-tests-main","f.zip"), recursive = TRUE, force = TRUE) +unlink(c("ffscrapr-tests-1.4.7","f.zip"), recursive = TRUE, force = TRUE) ``` diff --git a/vignettes/mfl_basics.Rmd b/vignettes/mfl_basics.Rmd index fe2f9c5d..e81ccddd 100644 --- a/vignettes/mfl_basics.Rmd +++ b/vignettes/mfl_basics.Rmd @@ -22,10 +22,10 @@ eval <- TRUE tryCatch(expr = { - download.file("https://github.com/ffverse/ffscrapr-tests/archive/main.zip","f.zip") + download.file("https://github.com/ffverse/ffscrapr-tests/archive/1.4.7.zip","f.zip") unzip('f.zip', exdir = ".") - httptest::.mockPaths(new = "ffscrapr-tests-main")}, + httptest::.mockPaths(new = "ffscrapr-tests-1.4.7")}, warning = function(e) eval <<- FALSE, error = function(e) eval <<- FALSE) @@ -157,6 +157,6 @@ Now that you've gotten this far, why not check out some of the other possibiliti ```{r include = FALSE} httptest::stop_mocking() -unlink(c("ffscrapr-tests-main","f.zip"), recursive = TRUE, force = TRUE) +unlink(c("ffscrapr-tests-1.4.7","f.zip"), recursive = TRUE, force = TRUE) ``` diff --git a/vignettes/mfl_getendpoint.Rmd b/vignettes/mfl_getendpoint.Rmd index 0d8e7fa9..e8a2ef28 100644 --- a/vignettes/mfl_getendpoint.Rmd +++ b/vignettes/mfl_getendpoint.Rmd @@ -22,10 +22,10 @@ eval <- TRUE tryCatch(expr = { - download.file("https://github.com/ffverse/ffscrapr-tests/archive/main.zip","f.zip") + download.file("https://github.com/ffverse/ffscrapr-tests/archive/1.4.7.zip","f.zip") unzip('f.zip', exdir = ".") - httptest::.mockPaths(new = "ffscrapr-tests-main")}, + httptest::.mockPaths(new = "ffscrapr-tests-1.4.7")}, warning = function(e) eval <<- FALSE, error = function(e) eval <<- FALSE) @@ -104,5 +104,5 @@ head(fog_tradebait) ```{r include = FALSE} httptest::stop_mocking() -unlink(c("ffscrapr-tests-main","f.zip"), recursive = TRUE, force = TRUE) +unlink(c("ffscrapr-tests-1.4.7","f.zip"), recursive = TRUE, force = TRUE) ``` diff --git a/vignettes/sleeper_basics.Rmd b/vignettes/sleeper_basics.Rmd index d5d85fc0..4e0640e5 100644 --- a/vignettes/sleeper_basics.Rmd +++ b/vignettes/sleeper_basics.Rmd @@ -23,10 +23,10 @@ eval <- TRUE tryCatch(expr = { - download.file("https://github.com/ffverse/ffscrapr-tests/archive/main.zip","f.zip") + download.file("https://github.com/ffverse/ffscrapr-tests/archive/1.4.7.zip","f.zip") unzip('f.zip', exdir = ".") - httptest::.mockPaths(new = "ffscrapr-tests-main")}, + httptest::.mockPaths(new = "ffscrapr-tests-1.4.7")}, warning = function(e) eval <<- FALSE, error = function(e) eval <<- FALSE) @@ -167,6 +167,6 @@ In this vignette, I've used ~three functions: ff_connect, ff_league, and ff_rost ```{r include = FALSE} httptest::stop_mocking() -unlink(c("ffscrapr-tests-main","f.zip"), recursive = TRUE, force = TRUE) +unlink(c("ffscrapr-tests-1.4.7","f.zip"), recursive = TRUE, force = TRUE) ``` diff --git a/vignettes/sleeper_getendpoint.Rmd b/vignettes/sleeper_getendpoint.Rmd index 16af8653..28a98c78 100644 --- a/vignettes/sleeper_getendpoint.Rmd +++ b/vignettes/sleeper_getendpoint.Rmd @@ -22,10 +22,10 @@ eval <- TRUE tryCatch(expr = { - download.file("https://github.com/ffverse/ffscrapr-tests/archive/main.zip","f.zip") + download.file("https://github.com/ffverse/ffscrapr-tests/archive/1.4.7.zip","f.zip") unzip('f.zip', exdir = ".") - httptest::.mockPaths(new = "ffscrapr-tests-main")}, + httptest::.mockPaths(new = "ffscrapr-tests-1.4.7")}, warning = function(e) eval <<- FALSE, error = function(e) eval <<- FALSE) @@ -95,6 +95,6 @@ There - this means something to us now! As of this writing (2020-11-10), Kalen B ```{r include = FALSE, eval = eval} httptest::stop_mocking() -unlink(c("ffscrapr-tests-main","f.zip"), recursive = TRUE, force = TRUE) +unlink(c("ffscrapr-tests-1.4.7","f.zip"), recursive = TRUE, force = TRUE) ```