httr::RETRYinstead - this adds some robustness for server-side issues. As suggested by Maelle Salmon’s blog post on not reinventing the wheel. (v18.104.22.168)
The main goal of ffscrapr 1.2.0 is to add a full set of methods for Fleaflicker. This release also adds improved caching options, including writing to your filesystem for persistent caching (see the vignette!), and one hotfix for sleeper_getendpoint.
sleeper_getendpoint()now behaves more like the other getendpoint functions - first argument is the endpoint and any further args are passed as query parameters.
All functions now have Fleaflicker methods! Here are notes about what isn’t the same:
Here is a list of new functions available at the top level (ie for all platforms)
ff_userleagues()returns a list of user leagues. This is deployed slightly differently for MFL and Sleeper - MFL requires authentication to access user’s leagues, while Sleeper doesn’t have authentication so you can look up any user you like.
ff_starters()returns a list of players started/not-started each week. MFL will return the actual score of each player each week and calculate whether they were optimal, while Sleeper just returns the player themselves.
Almost all functions now have Sleeper methods - implemented in what hopes to be relatively familiar manner to MFL. Outlining the specifics of what isn’t the same:
sleeper_userleagues()is a wrapper on
ff_userleagues()that makes it easier to look up user leagues without first creating a connection object.
ff_playerscores()is not available for Sleeper because Sleeper removed the player stats endpoint - it will generate a warning (rather than an error). Thinking about creating some functions to calculate scoring based on nflfastr.
sleeper_getendpoint()is a little more simple than MFL’s equivalent - just pass a string url (minus api.sleeper.app/v1) or pass in chunks of code, the function will automatically paste them together with “/”.
ff_userleagues()- Sleeper league IDs are more annoying than MFL to handle, so the more intuitive way is to look up the user’s league_ids by username first. MFL does have a parallel feature even if used for different purposes.
This is the first (major) version of ffscrapr and it is intended to build out the full set of functions for the first API platform: MFL.
Future versions will add more platforms via methods mapped to the same functions.
mfl_connect) to establish connection parameters and ratelimiting
mfl_getendpointas a low-level function for making GET requests from MFL
ff_draftgets draft results
ff_draftpicksgets current and future draft picks that have not yet been selected
ff_franchisesgets franchise-level identifiers and divisions
ff_leaguegets league-level summaries of rules, players, and franchises
ff_playerscoresgets playerweek-level scores
ff_rostersgets franchise-level rosters complete with naming
ff_schedulegets weekly fantasy schedules
ff_scoringgets scoring rules
ff_standingsgets league-level season summaries
ff_transactionsgets a list of all transactions and cleans them into a data frame.