diff --git a/R/buildtools.R b/R/buildtools.R index 291cc98..52c1775 100644 --- a/R/buildtools.R +++ b/R/buildtools.R @@ -466,6 +466,7 @@ get_maintainer_info <- function(path = '.'){ if(nchar(login)){ info$login <- tolower(login) info$mastodon <- scrape_github_mastodon(login) + info$bluesky <- scrape_github_bluesky(login) } uuid <- Sys.getenv('MAINTAINERUUID', "") if(nchar(uuid)){ @@ -496,6 +497,16 @@ scrape_github_mastodon <- function(login){ }, error = message) } +scrape_github_bluesky <- function(login){ + tryCatch({ + doc <- xml2::read_html(paste0("http://github.com/", login)) + link <- xml2::xml_find_all(doc, '//li[svg/title = "Bluesky"]/a') + if(length(link)){ + xml2::xml_attr(link, 'href') + } + }, error = message) +} + normalize_tags <- function(x){ x <- unique(tolower(x)) setdiff(x, c("r", "rstats", "cran", "r-cran", "cran-r", "r-package", "r-packages", "rpackage", "package", "r-stats", "rstats-package"))