Save in exceptions
This commit is contained in:
parent
e5d613360b
commit
bfabf33842
@ -1,4 +1,4 @@
|
|||||||
1,google.com
|
1,google.com,true
|
||||||
2,youtube.com
|
2,youtube.com,false
|
||||||
4,tmall.com
|
4,tmall.com,nil
|
||||||
5,idecrea.es
|
5,idecrea.es,nil
|
|
@ -27,9 +27,16 @@
|
|||||||
[& args]
|
[& args]
|
||||||
(let [;; Name of the file containing the CSV with the domains
|
(let [;; Name of the file containing the CSV with the domains
|
||||||
file-csv "top-1m-test.csv"
|
file-csv "top-1m-test.csv"
|
||||||
;; List with domains
|
;; Get domains from CSV
|
||||||
domains (read-csv-domains file-csv)
|
domains-csv (vec (read-csv-domains file-csv))
|
||||||
|
;; Filters leaving those that have not been checked
|
||||||
|
domains-unchecked (filter #(= (get % 2) "nil") domains-csv)]
|
||||||
|
(def mod-domains-csv domains-csv)
|
||||||
;; List with domains with a boolean indicating if it is generate or not in WordPress
|
;; List with domains with a boolean indicating if it is generate or not in WordPress
|
||||||
domains-checks (doall (vec (map #(conj % (wordpress? (get % 1))) domains)))]
|
(doseq [domain-data domains-unchecked] (let [domain (get domain-data 1)
|
||||||
|
;; Check if domain it is generate or not in WordPress
|
||||||
|
check-wordpress (wordpress? domain)]
|
||||||
|
;; Edit domains-csv with check WordPress
|
||||||
|
(def mod-domains-csv (map #(-> (if (= domain (get % 1)) (assoc % 2 (str check-wordpress)) %)) mod-domains-csv))
|
||||||
;; Save domains to CSV
|
;; Save domains to CSV
|
||||||
(save-csv-domains file-csv domains-checks)))
|
(save-csv-domains file-csv mod-domains-csv)))))
|
||||||
|
Loading…
Reference in New Issue
Block a user