4.1 KiB
4.1 KiB
In [1]:
(require '[cheshire.core :as cheshire])In [2]:
(def election-results-url "https://dgeq.org/doc/gen7-4-2014/resultats.json")Out [2]:
#'user/election-results-url
In [3]:
(def raw-data (slurp election-results-url))Out [3]:
#'user/raw-data
In [9]:
(println "the length of the string is..." (count raw-data))
(println "the string starts with..." (subs raw-data 0 50))the length of the string is... 193056
the string starts with... {"statistiques":{"partisPolitiques":[{"numeroParti
In [12]:
(def data (cheshire/parse-string raw-data true))Out [12]:
#'user/data
In [14]:
(println "the data structure type is... " (type data))
(println "the keys are... " (keys data))the data structure type is... clojure.lang.PersistentArrayMap the keys are... (:statistiques :circonscriptions)
In [25]:
(spit "resources/data/election-2014.edn" (str data))In [ ]: