Hey,
I only glanced over the discussion, but I think you have a type problem.
Keyword vs. Strings to be precise, the JSON data you pasted will not
convert to keyword keys by default I think.
So instead of (core/get-in forecast [:dayPrecipitation :temp])
try (core/get-in forecast ["dayPrecipita
2013/5/10 Bryan Henderson
> What map would be defined for the first argument with the given code? It
> seems like how it is set up, it is grabbing information straight from the
> JSON data without a map defined.
>
Parsed JSON
> The 'format-forecast' definition takes forecast as an arg so I
What map would be defined for the first argument with the given code? It
seems like how it is set up, it is grabbing information straight from the
JSON data without a map defined. The 'format-forecast' definition takes
forecast as an arg so I tried it like this with no luck:
*:hour-summary (core
2013/5/10 Hawkeye02
> :hour-summary (core/get-in :dayPrecipitation [:temp] forecast)
I don't think you use get-in the way it is demonstrated in the examples. It
takes a map
as the first argument and a collection of keys to traverse.
http://clojuredocs.org/clojure_core/clojure.core/get-in
Also
Forgot to put the JSON data:
"radarStation":"lot","dayPrecipitation":[{"time":1368129600,"probability":0.23,"type":"rain","temp":74,"cloudCover":1,"relHumidity":0.45},..
On Thursday, May 9, 2013 4:10:44 PM UTC-5, Hawkeye02 wrote:
>
> Thanks Greg for the suggestion. I have added the book to
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
You might want to check out "Clojure Data Analysis Handbook" by Eric
Rochester. There is an example using org.clojure/data.json and Incanter to
read JSON format into an Incanter dataset. You might find other recipes in
the book useful as well:
http://www.packtpub.com/clojure-data-analysis-coo
Michael,
Thank you for the response and references. I will try your suggestions and
get back to you. My terminology isn't the best, thanks for deciphering.
On Tuesday, May 7, 2013 11:27:01 AM UTC-5, Michael Klishin wrote:
>
>
> 2013/5/7 Hawkeye02 >
>
>> I can't get the data from inside the
2013/5/7 Hawkeye02
> I can't get the data from inside the JSON arrays from Clojure.
> Specifically, I looking to get the data from the "currently" array taken
> from this Dark Sky data:
Sorry but your JSON document example does not have arrays. Do you mean
nested objects (maps)?
Parsed JSON d
Hello everyone. Hopefully this is an easy question to answer.
Our company is using a dashboard application that uses Clojure called
Brainiac (https://github.com/cmonty/brainiac). It accesses weather data
from Dark Sky. Dark Sky has upgraded their API and now the weather data is
in arrays, wh
10 matches
Mail list logo