Update check.r

This commit is contained in:
François Briatte 2023-04-27 00:04:41 +02:00
parent dc5d1af045
commit cfd8deddda

View File

@ -25,7 +25,7 @@ if (!file.exists(f)) {
u <- GET(u) %>%
content("text") %>%
str_split("\\n") %>% # so as to find [foo]: bar links
unlist
unlist()
# total number of links (made to match web.archive.org links only once)
t <- sum(str_count(u, "(?<!/)http"))
@ -36,10 +36,10 @@ if (!file.exists(f)) {
# [foo](bar)
str_extract_all(u, "\\(http(.*?)\\)") %>%
lapply(str_replace_all, "^\\(|\\)$", "") %>%
unlist,
unlist(),
# [foo]: bar
str_extract_all(u, "^\\[(.*)\\]: (.*)") %>%
unlist %>%
unlist() %>%
str_replace("^\\[(.*)\\]: (.*)", "\\2")
)