mirror of
https://github.com/briatte/awesome-network-analysis.git
synced 2024-10-01 01:06:13 -04:00
log URL errors
This commit is contained in:
parent
3fef0b5ce4
commit
3f9c3556d0
8
check.r
8
check.r
@ -36,7 +36,7 @@ cat(length(l), "unique\n")
|
||||
|
||||
for (i in l) {
|
||||
|
||||
if (!which(l == i) %% 25)
|
||||
if (!which(l == i) %% 50)
|
||||
cat(length(l) - which(l == i), "left\n")
|
||||
|
||||
x <- try(GET(i) %>%
|
||||
@ -44,9 +44,15 @@ for (i in l) {
|
||||
silent = TRUE)
|
||||
|
||||
if (!"try-error" %in% class(x) && x != 200) {
|
||||
cat("x")
|
||||
sink("check.log", append = TRUE)
|
||||
cat("\nURL:", i, "\nStatus code:", x, "\n")
|
||||
sink()
|
||||
} else if("try-error" %in% class(x)) {
|
||||
cat("x")
|
||||
sink("check.log", append = TRUE)
|
||||
cat("\nURL:", i, "\nFailed to access\n.")
|
||||
sink()
|
||||
} else {
|
||||
cat(".")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user