mirror of
https://github.com/briatte/awesome-network-analysis.git
synced 2025-01-23 21:11:11 -05:00
Update check.r
This commit is contained in:
parent
dc5d1af045
commit
cfd8deddda
6
check.r
6
check.r
@ -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")
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user