Last active
December 1, 2020 04:54
-
-
Save jimbrig/043200ff5e649ed88f87ac0432221501 to your computer and use it in GitHub Desktop.
[Github Stars] R Script to Retrieve Github Starred Repos #dev #github #pinned #r
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (!require("pacman")) install.packages("pacman") | |
| pacman::p_load( | |
| dplyr, | |
| tidyselect, | |
| DT, | |
| gh | |
| ) | |
| pacman::p_load_current_gh("ropenscilabs/roomba") | |
| if (!requireNamespace("gh", quietly = TRUE)) { | |
| install.packages("gh") | |
| } | |
| if (!requireNamespace("roomba", quietly = TRUE)) { | |
| library(devtools) | |
| install_github("ropenscilabs/roomba") | |
| } | |
| library(dplyr) | |
| gh::gh("/user/starred") %>% | |
| roomba::roomba( | |
| cols = c("name", "full_name", "html_url", "homepage", "description", | |
| "git_url", "stargazers_count", "watchers_count", | |
| "open_issues_count", "created_at", "updated_at") | |
| ) %>% | |
| mutate( | |
| name = glue::glue('<a href="{homepage}">{name}</a>'), | |
| full_name = glue::glue('<a href="{html_url}">{full_name}</a>') | |
| ) %>% | |
| mutate_at(vars(ends_with("_at")), lubridate::ymd_hms) %>% | |
| mutate_at(vars(ends_with("_at")), strftime, format = "%F") %>% | |
| select( | |
| Name = name, | |
| Repo = full_name, | |
| Description = description, | |
| Stars = stargazers_count, | |
| Watchers = watchers_count, | |
| `Open Issues` = open_issues_count, | |
| Created = created_at, | |
| Updated = updated_at, | |
| `git url` = git_url | |
| ) %>% | |
| DT::datatable(filter = "top", escape = FALSE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment