From d817ed334ae3f4029e9e1041de652be75c61b283 Mon Sep 17 00:00:00 2001 From: Andros Fenollosa Date: Fri, 11 Oct 2019 20:25:37 +0200 Subject: [PATCH] Add header --- src/wordpress_used/core.clj | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wordpress_used/core.clj b/src/wordpress_used/core.clj index d351637..59277f2 100644 --- a/src/wordpress_used/core.clj +++ b/src/wordpress_used/core.clj @@ -6,6 +6,8 @@ [clojure.java.shell :as shell] ) (:gen-class)) +(def h {"User-Agent" "Mozilla/5.0 (Windows NT 6.1;) Gecko/20100101 Firefox/13.0.1"}) + (defn read-csv-domains "Read CSV file with all domains" [url] @@ -16,7 +18,7 @@ "Check if a web page is generated with WordPress" [url] (try - (let [response (client/get (str "http://" url "/") {:ignore-unknown-host? true, :connection-timeout 5000, :throw-exceptions false})] + (let [response (client/get (str "http://" url "/") {:headers h :ignore-unknown-host? true, :connection-timeout 5000, :throw-exceptions false})] (every? identity [(re-find (re-pattern "meta.*generator.*WordPress") (:body response))])) (catch Exception e "timeout"