Hello I've been using this:
curl -s "http://api.openweathermap.org/data/2.5/forecast?id=6361046&APPID=6be5e3a6e62680c28044791e8fc7b568&units=metric" -o ~/.cache/weather.json
to write a weather.json file in my cache folder. the output is this. the problem is that it's only in 1 line and I'm trying to use grep to get an output of the icon value of today:
{"cod":"200","message":0,"cnt":40,"list":[{"dt":1574629200,"main":{"temp":12.8,"temp_min":12.8,"temp_max":13.07,"pressure":1020,"sea_level":1020,"grnd_level":1012,"humidity":82,"temp_kf":-0.27},"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04n"}]
which in this case is "04n" so I can use something like this:
~/.weather-icons/$(grep "icon" ~/.cache/weather.json).png
that would output ~/.weather-icons/04n.png
so I can use the icon from my folder with the same name as the icon value to display in conky using $image. My question is how can i get this done? I don't know if there is a better command to read a file.json using the parameters shown here or if there is a way I can use grep to just output the icon value. Thanks