Thanks Greg for the suggestion. I have added the book to my Safari account.
Michael, I tried your suggestion with 'get-in' and it came back with [object Object] from JSON. I switched the clojure.contrib stuff with data.json.
Below is the updated code and a screenshot of the result. Thanks in advance for any guidance.
(ns brainiac.plugins.dark-sky
(:require [brainiac.plugin :as brainiac]
[clojure.data.json :as json]
[clojure.core :as core]))
(defn format-forecast [forecast]
{
:temp (:currentTemp forecast)
:current-summary (:currentSummary forecast)
:hour-summary (core/get-in :dayPrecipitation [:temp] forecast)
:minutes-until-change (:minutesUntilChange forecast)
})
(defn transform [stream]
(let [json (json/read-json (io/reader stream))]
(assoc {}
:name "dark-sky"
:title "Right now, outside..."
:data (format-forecast json))))
(defn url [api-key lat lon]
(defn configure [{:keys [api-key lat lon program-name]}]
(brainiac/simple-http-plugin
{:url (url api-key lat lon)}
transform program-name))
