From 174a7426057dfdebe78d525f59c621d0665e454e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Briatte?= Date: Tue, 14 Mar 2017 09:40:30 +0100 Subject: [PATCH] URL checks --- check.log | 60 +++++++++++++++++++++++++++---------------------------- check.r | 24 ++++++++++------------ 2 files changed, 40 insertions(+), 44 deletions(-) diff --git a/check.log b/check.log index 77f74da..dd54c66 100644 --- a/check.log +++ b/check.log @@ -1,36 +1,36 @@ -2017-01-02 19:46:05 : checking 11 URLs +2017-03-14 09:04:07 : checking 11 URLs -http://derekgreene.com/gephitutorial/ -Status code: 404 - -http://nexus.igraph.org/ -Failed to access - -http://www.derekruths.com/ -Status code: 403 - -http://www.nature.com/nature/journal/v445/n7127/full/445489a.html -Status code: 401 - -http://www.ssc.wisc.edu/~emirbaye/Mustafa_Emirbayer/ARTICLES_files/manifesto%20for%20a%20relational%20sociology.pdf -Status code: 404 - -http://www.ssc.wisc.edu/~emirbaye/Mustafa_Emirbayer/ARTICLES_files/network%20analysis,%20culture,%20and%20the%20problem%20of%20agency.pdf -Status code: 404 - -https://410f84824e101297359cc81c78f45c7c079eb26c.googledrive.com/host/0Bz6WHrWac3FrWnA5MjZqb3lWa2c/ -Status code: 404 - -https://dlist.server.uni-frankfurt.de/mailman/listinfo/sna-de +http://asonam.cpsc.ucalgary.ca/ Status code: 400 -https://lra.le.ac.uk/bitstream/2381/36068/2/Draft%20BJM%20Revised%20(3rd%20iteration)%20Manuscript.pdf -Status code: 501 +http://comnet.oxfordjournals.org/ +Failed to access -https://www.linkedin.com/in/mcculloh -Status code: 999 +http://comnet.oxfordjournals.org/content/4/3/457.short +Failed to access -https://www.puf.com/content/R%C3%A9seaux_sociaux_et_structures_relationnelles -Status code: 501 +http://netzwerkerei.org/ +Status code: 403 -2017-01-02 19:46:09 : done. +http://nexus.igraph.org/ +Failed to access + +http://www.clementlevallois.net/gephi.html +Status code: 404 + +http://www.cmh.pro.ens.fr/reseaux-sociaux/ +Failed to access + +http://www.derekruths.com/ +Status code: 403 + +http://www.esri.com/software/arcgis/extensions/networkanalyst +Status code: 403 + +http://www.melissaclarkson.com/resources/R_guides/ +Status code: 500 + +http://www.nature.com/nature/journal/v445/n7127/full/445489a.html +Status code: 401 + +2017-03-14 09:08:15 : done. diff --git a/check.r b/check.r index 836d81c..bd4356a 100644 --- a/check.r +++ b/check.r @@ -28,8 +28,7 @@ if (!file.exists(f)) { unlist # total number of links - t <- str_count(u, "http") %>% - sum + t <- sum(str_count(u, "http")) cat(t, "URLs, ") @@ -50,15 +49,13 @@ if (!file.exists(f)) { cat("Source:", f, "\n") - l <- readLines(f) %>% - str_subset("^http") + l <- str_subset(readLines(f), "^http") cat(length(l), "URLs, ") } -l <- unique(l) %>% - sort +l <- sort(unique(l)) cat(length(l), "unique\n") @@ -68,9 +65,7 @@ sink() for (i in l) { - x <- try(GET(i) %>% - status_code, - silent = TRUE) + x <- try(status_code(GET(i)), silent = TRUE) if (!"try-error" %in% class(x) && x != 200) { @@ -80,7 +75,7 @@ for (i in l) { cat(i, "\nStatus code:", x, "\n\n") sink() - } else if("try-error" %in% class(x)) { + } else if ("try-error" %in% class(x)) { cat("?") @@ -94,8 +89,11 @@ for (i in l) { } - if (!which(l == i) %% 50) + if (!which(l == i) %% 50) { + cat("", length(l) - which(l == i), "left\n") + + } } @@ -103,6 +101,4 @@ sink(f, append = TRUE) cat(as.character(Sys.time()), ": done.\n") sink() -cat("\nFound", str_count(readLines(f), "^http") %>% - sum, - "problems.\n") +cat("\nFound", sum(str_count(readLines(f), "^http")), "problems.\n")