diff --git a/main.odin b/main.odin index 0e019ae..0c3f056 100644 --- a/main.odin +++ b/main.odin @@ -58,16 +58,17 @@ main :: proc() { } weather_location := weather.name - weather_code := weather.sys.country + weather_code := weather.country + weather_resp := weather.weather[0].main weather_resp_detail := weather.weather[0].description - //weather_icon := weather.weather[0].icon - temperature := weather.main.temp - feels_like_temp := weather.main.feels_like - temp_min := weather.main.temp_min - temp_max := weather.main.temp_max - sunset_time := time.to_string_hms_12(time.unix(weather.sys.sunset, 0), buf1[:]) - sunrise_time := time.to_string_hms_12(time.unix(weather.sys.sunrise, 0), buf2[:]) + + temperature := weather.temp + feels_like_temp := weather.feels_like + temp_min := weather.temp_min + temp_max := weather.temp_max + sunset_time := time.to_string_hms_12(time.unix(weather.sunset, 0), buf1[:]) + sunrise_time := time.to_string_hms_12(time.unix(weather.sunrise, 0), buf2[:]) fmt.println("Location:", weather_location) fmt.println("Country Code:", weather_code) diff --git a/weather.odin b/weather.odin index 8182d0b..6eda085 100644 --- a/weather.odin +++ b/weather.odin @@ -44,17 +44,17 @@ Visibility :: struct { } WeatherResponse :: struct { - clouds: Clouds, - sys: Sys, - name: string, - base: string, - coord: Coord, - timezone: int, - weather: []Weather, - main: Main, - visibility: int, - dt: f64, - id: int, - wind: Wind, - cod: int, + using clouds: Clouds, + using sys: Sys, + name: string, + base: string, + using coord: Coord, + timezone: int, + weather: []Weather, + using main: Main, + visibility: int, + dt: f64, + id: int, + using wind: Wind, + cod: int, }