{"id":16272616,"url":"https://github.com/jemus42/speedrunr","last_synced_at":"2025-03-19T23:31:06.933Z","repository":{"id":74354128,"uuid":"138516905","full_name":"jemus42/speedrunr","owner":"jemus42","description":"A speedrun.com API wrapper for R","archived":false,"fork":false,"pushed_at":"2024-03-18T13:56:30.000Z","size":16039,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-14T18:58:53.902Z","etag":null,"topics":["api-wrapper","r-package","rstats","speedruncom"],"latest_commit_sha":null,"homepage":"https://jemus42.github.io/speedrunr/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jemus42.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-24T21:33:22.000Z","updated_at":"2024-02-01T08:26:27.000Z","dependencies_parsed_at":"2024-02-02T14:14:46.285Z","dependency_job_id":"7cd90ac4-abb3-4a90-8784-b91c27bfe811","html_url":"https://github.com/jemus42/speedrunr","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jemus42%2Fspeedrunr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jemus42%2Fspeedrunr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jemus42%2Fspeedrunr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jemus42%2Fspeedrunr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jemus42","download_url":"https://codeload.github.com/jemus42/speedrunr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244031029,"owners_count":20386534,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-wrapper","r-package","rstats","speedruncom"],"created_at":"2024-10-10T18:18:29.688Z","updated_at":"2025-03-19T23:31:06.391Z","avatar_url":"https://github.com/jemus42.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\neditor_options: \n  chunk_output_type: console\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r setup, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  cache = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# speedrunr\n\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/jemus42/speedrunr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/jemus42/speedrunr/actions/workflows/R-CMD-check.yaml)\n[![CRAN status](https://www.r-pkg.org/badges/version/speedrunr)](https://cran.r-project.org/package=speedrunr)\n[![GitHub release](https://img.shields.io/github/release/jemus42/speedrunr.svg?logo=GitHub)](https://github.com/jemus42/speedrunr/releases) \n[![GitHub last commit (master)](https://img.shields.io/github/last-commit/jemus42/speedrunr/master.svg?logo=GithUb)](https://github.com/jemus42/speedrunr/commits/master)\n[![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/)\n\u003c!-- badges: end --\u003e\n\nThe goal of speedrunr is to easily access data from [speedrun.com](https://speedrun.com).\n\n## Installation\n\nYou can install the released version of speedrunr from GitHub with:\n\n``` r\npak::pak(\"jemus42/speedrunr\")\n```\n\n## Example\n\nLet's say you want to plot the times of all *Ocarina of TIme 100%* runs.  \nLet's get started:\n\n```{r, message=FALSE, error=FALSE}\nlibrary(speedrunr)\nlibrary(dplyr) # Data manip\nlibrary(knitr) # Tables\n```\n\n\n### Identifiyng the game you're looking for\n\nYou can either search for \"Ocarina of Time\", or supply `'oot'`, the game's abbreviation on speedrun.com.\n\n```{r}\ngames \u003c- get_games(name = \"Ocarina of Time\")\n\ngames %\u003e% \n  select(id, name_international, name_abbr) %\u003e%\n  head() %\u003e%\n  kable()\n```\n\nTurns out `j1l9qz1g` is the id we're looking for.\n\n### Get the game's categories\n\n```{r}\ncategories \u003c- get_categories(id = \"j1l9qz1g\")\n\ncategories %\u003e%\n  select(id, name, type) %\u003e%\n  head() %\u003e%\n  kable()\n```\n\nSo apparently we're looking for `q255jw2o`, the full-game 100% category.\n\n### Get the runs in that category\n\nNow we can fetch the runs. By default, 100 runs are returned, ordered by submit date in descending order, so newest runs first. This also means you will only be able to fully assess the WR progression if you make sure to get _all_ the runs.\n\n```{r}\nruns \u003c- get_runs(game = \"j1l9qz1g\", category = \"q255jw2o\")\n\nglimpse(runs)\n```\n\nAnd now we can basically re-create the leaderboard, but including obsoleted runs:\n\n```{r}\nlibrary(hms)\n\nruns %\u003e%\n  arrange(time_primary) %\u003e%\n  head(20) %\u003e%\n  select(submitted, time_primary, player_name) %\u003e%\n  mutate(time_primary = hms(seconds = time_primary)) %\u003e%\n  kable()\n```\n\n### More data\n\nWanna resolve those platforms? Just join with this table:\n\n```{r}\nget_platforms() %\u003e%\n  head() %\u003e%\n  kable()\n```\n\nSame can be done with regions:\n\n```{r}\nget_regions() %\u003e%\n  kable()\n```\n\n\nThere are also convenience functions to pipe your `runs` object into:\n\n- `add_platforms()`\n- `add_regions()`\n- `add_players()`, which only makes on API call per unique player.\n\nAll of them work in the following way:\n\n```{r}\nruns %\u003e% \n  add_regions() %\u003e%\n  add_platforms() %\u003e%\n  select(time_primary, system_region, system_platform) %\u003e%\n  sample_n(5) %\u003e%\n  knitr::kable()\n```\n\n## Code of Conduct\n\nPlease note that this project is released with a [Contributor Code of Conduct](.github/CODE_OF_CONDUCT.md).\nBy participating in this project you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjemus42%2Fspeedrunr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjemus42%2Fspeedrunr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjemus42%2Fspeedrunr/lists"}