From 89b27d4d20b16f6d64313a9b848da4ed30f69cf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Briatte?= Date: Mon, 2 Jan 2017 05:14:42 +0100 Subject: [PATCH] user agent setting --- check.r | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/check.r b/check.r index 03d5de6..46e4031 100644 --- a/check.r +++ b/check.r @@ -2,6 +2,7 @@ library(httr) library(stringr) f <- "check.log" +a <- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36" if (!file.exists(f)) { @@ -59,7 +60,7 @@ sink() for (i in l) { - x <- try(GET(i) %>% + x <- try(GET(i, user_agent(a)) %>% status_code, silent = TRUE)