Skip to content

Commit

Permalink
Scrape bluesky icons
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Nov 21, 2024
1 parent 52f61c3 commit 405d78d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions R/buildtools.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)){
Expand Down Expand Up @@ -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"))
Expand Down

0 comments on commit 405d78d

Please sign in to comment.