Add repo is-wordpress
This commit is contained in:
parent
91584d565f
commit
e6eef9b5e9
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[submodule "is-wordpress"]
|
||||
path = is-wordpress
|
||||
url = git@github.com:tanrax/is-wordpress.git
|
@ -5,4 +5,4 @@ NUM_NOT_WORDPRESS=$(cat $CSV | grep ,false$ | wc -l)
|
||||
NUM_TIMEOUT=$(cat $CSV | grep ,timeout$ | wc -l)
|
||||
TOTAL=$(cat $CSV | wc -l)
|
||||
|
||||
echo "($NUM_WORDPRESS * 100) / ($TOTAL - $NUM_TIMEOUT)" | bc
|
||||
echo "($NUM_WORDPRESS * 100) / ($TOTAL - $NUM_TIMEOUT)" | bc | awk '{print $1"%"}'
|
||||
|
1
is-wordpress
Submodule
1
is-wordpress
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit b64770eb63dcb3924957bed824e79d380089e2c2
|
@ -5,10 +5,10 @@
|
||||
[clojure.java.shell :as shell]
|
||||
) (:gen-class))
|
||||
|
||||
(defn request
|
||||
"Make a request by means of curl"
|
||||
(defn wordpress?
|
||||
"Check if a web page is generated with WordPress"
|
||||
[url]
|
||||
(shell/sh "curl" "-L" "-m" "5" "-H" "User-Agent: Firefox" url))
|
||||
(= (clojure.string/trim-newline (:out (shell/sh "bash" "./is-wordpress/is-wordpress" url))) "true"))
|
||||
|
||||
|
||||
(defn read-csv-domains
|
||||
@ -17,11 +17,6 @@
|
||||
(with-open [reader (io/reader (io/resource url))]
|
||||
(doall (csv/read-csv reader))))
|
||||
|
||||
(defn wordpress?
|
||||
"Check if a web page is generated with WordPress"
|
||||
[url]
|
||||
(let [response (request url)]
|
||||
(every? identity [(re-find (re-pattern "meta.*generator.*WordPress") (:out response))])))
|
||||
|
||||
(defn -main
|
||||
[& args]
|
||||
|
Loading…
Reference in New Issue
Block a user