do not check <!-- commented out--> URLs
parent
8eddfd49cd
commit
65514acfb6
8
check.r
8
check.r
|
@ -27,6 +27,9 @@ if (!file.exists(f)) {
|
||||||
str_split("\\n") %>% # so as to find [foo]: bar links
|
str_split("\\n") %>% # so as to find [foo]: bar links
|
||||||
unlist()
|
unlist()
|
||||||
|
|
||||||
|
# remove links that have been commented out
|
||||||
|
u <- str_remove_all(u, "<!--.*?-->")
|
||||||
|
|
||||||
# total number of links (made to match web.archive.org links only once)
|
# total number of links (made to match web.archive.org links only once)
|
||||||
t <- sum(str_count(u, "(?<!/)http"))
|
t <- sum(str_count(u, "(?<!/)http"))
|
||||||
|
|
||||||
|
@ -101,7 +104,8 @@ for (i in l) {
|
||||||
}
|
}
|
||||||
|
|
||||||
sink(f, append = TRUE)
|
sink(f, append = TRUE)
|
||||||
cat(as.character(Sys.time()), ": done.\n")
|
f <- sum(str_count(stringi::stri_read_lines(f), "^http"))
|
||||||
|
cat(as.character(Sys.time()), ": done,", f, "errors.\n")
|
||||||
sink()
|
sink()
|
||||||
|
|
||||||
cat("\n", sum(str_count(stringi::stri_read_lines(f), "^http")), "problems\n")
|
cat("\n", f, "errors\n")
|
||||||
|
|
Loading…
Reference in New Issue