briandowns/openweathermap

example for daily forecast

ilmanzo opened this issue · 2 comments

Hi, is it possible to have an example of usage about getting the forecast for the next day ? It's not totally clear to me how to retrieve the values from the returned *ForecastWeatherData after calling DailyByID.

Many Thanks

I'm also interested in this. It does not seem to work the same way as the get current weather method. Do we have to Decode ourselves?

Any chance on an explanation?

When I print fmt.Printf("%+v\n",we.ForecastWeatherJson) it shows below string:
&{City:{ID:X Name:X:{Longitude:X Latitude:X} Country:X Population:45292 Sys:{Population:0}} Cnt:5 List:[{Dt:1533200400 Main:{Temp:29.71 TempMin:26.31 TempMax:29.71 Pressure:1035.79 SeaLevel:1036.74 GrndLevel:1035.79 Humidity:56} Weather:[{ID:800 Main:Clear Description:clear sky Icon:01d}] Clouds:{All:0} Wind:{Speed:2.08 Deg:119.502} Rain:{ThreeH:0} Snow:{ThreeH:0} DtTxt:2018-08-02 09:00:00 +0000 UTC} {Dt:1533211200 Main:{Temp:32.25 TempMin:29.7 TempMax:32.25 Pressure:1035.29 SeaLevel:1036.31 GrndLevel:1035.29 Humidity:49} Weather:[{ID:800 Main:Clear Description:clear sky Icon:01d}] Clouds:{All:0} Wind:{Speed:1.71 Deg:295.004} Rain:{ThreeH:0} Snow:{ThreeH:0} DtTxt:2018-08-02 12:00:00 +0000 UTC} {Dt:1533222000 Main:{Temp:32.22 TempMin:30.52 TempMax:32.22 Pressure:1034.72 SeaLevel:1035.8 GrndLevel:1034.72 Humidity:43} Weather:[{ID:800 Main:Clear Description:clear sky Icon:01d}] Clouds:{All:0} Wind:{Speed:2.51 Deg:317.003} Rain:{ThreeH:0} Snow:{ThreeH:0} DtTxt:2018-08-02 15:00:00 +0000 UTC} {Dt:1533232800 Main:{Temp:29.59 TempMin:28.74 TempMax:29.59 Pressure:1034.82 SeaLevel:1035.72 GrndLevel:1034.82 Humidity:41} Weather:[{ID:800 Main:Clear Description:clear sky Icon:01d}] Clouds:{All:0} Wind:{Speed:3.66 Deg:337.001} Rain:{ThreeH:0} Snow:{ThreeH:0} DtTxt:2018-08-02 18:00:00 +0000 UTC} {Dt:1533243600 Main:{Temp:22.91 TempMin:22.91 TempMax:22.91 Pressure:1035.62 SeaLevel:1036.53 GrndLevel:1035.62 Humidity:55} Weather:[{ID:800 Main:Clear Description:clear sky Icon:01n}] Clouds:{All:0} Wind:{Speed:3.72 Deg:344.001} Rain:{ThreeH:0} Snow:{ThreeH:0} DtTxt:2018-08-02 21:00:00 +0000 UTC}]}

So I assume I can do the following: we.ForecastWeatherJson.City, which is not the case.