Skip to content

Commit 405d78d

Browse files
committed
Scrape bluesky icons
1 parent 52f61c3 commit 405d78d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

R/buildtools.R

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ get_maintainer_info <- function(path = '.'){
466466
if(nchar(login)){
467467
info$login <- tolower(login)
468468
info$mastodon <- scrape_github_mastodon(login)
469+
info$bluesky <- scrape_github_bluesky(login)
469470
}
470471
uuid <- Sys.getenv('MAINTAINERUUID', "")
471472
if(nchar(uuid)){
@@ -496,6 +497,16 @@ scrape_github_mastodon <- function(login){
496497
}, error = message)
497498
}
498499

500+
scrape_github_bluesky <- function(login){
501+
tryCatch({
502+
doc <- xml2::read_html(paste0("http://github.com/", login))
503+
link <- xml2::xml_find_all(doc, '//li[svg/title = "Bluesky"]/a')
504+
if(length(link)){
505+
xml2::xml_attr(link, 'href')
506+
}
507+
}, error = message)
508+
}
509+
499510
normalize_tags <- function(x){
500511
x <- unique(tolower(x))
501512
setdiff(x, c("r", "rstats", "cran", "r-cran", "cran-r", "r-package", "r-packages", "rpackage", "package", "r-stats", "rstats-package"))

0 commit comments

Comments
 (0)