Add header

This commit is contained in:
Andros Fenollosa 2019-10-11 20:25:37 +02:00 committed by GitHub
parent 28dac9ad47
commit d817ed334a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,6 +6,8 @@
[clojure.java.shell :as shell] [clojure.java.shell :as shell]
) (:gen-class)) ) (:gen-class))
(def h {"User-Agent" "Mozilla/5.0 (Windows NT 6.1;) Gecko/20100101 Firefox/13.0.1"})
(defn read-csv-domains (defn read-csv-domains
"Read CSV file with all domains" "Read CSV file with all domains"
[url] [url]
@ -16,7 +18,7 @@
"Check if a web page is generated with WordPress" "Check if a web page is generated with WordPress"
[url] [url]
(try (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))])) (every? identity [(re-find (re-pattern "meta.*generator.*WordPress") (:body response))]))
(catch Exception e (catch Exception e
"timeout" "timeout"