From 4f2d76131c26f9c13b8855f09b3f8aa55e4d90fe Mon Sep 17 00:00:00 2001 From: kvij <19838921+kvij@users.noreply.github.com> Date: Mon, 1 Jul 2024 22:44:23 +0200 Subject: [PATCH] Switch OneCall to API 3.0 (#110) Switching from the discontinued 2.5 to using the 3.0 OneCall API works for a lot of calls. Needs more work to be fully compatible. Other 2.5 API's are still available. --- openweathermap.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openweathermap.go b/openweathermap.go index 1aefa5b..5d2f376 100644 --- a/openweathermap.go +++ b/openweathermap.go @@ -35,7 +35,7 @@ var ( var DataUnits = map[string]string{"C": "metric", "F": "imperial", "K": "internal"} var ( baseURL = "https://api.openweathermap.org/data/2.5/weather?%s" - onecallURL = "https://api.openweathermap.org/data/2.5/onecall?%s" + onecallURL = "https://api.openweathermap.org/data/3.0/onecall?%s" iconURL = "https://openweathermap.org/img/w/%s" groupURL = "http://api.openweathermap.org/data/2.5/group?%s" stationURL = "https://api.openweathermap.org/data/2.5/station?id=%d" @@ -185,8 +185,8 @@ type Clouds struct { All int `json:"all"` } -// return key -// } +// return key +// } func setKey(key string) (string, error) { if err := ValidAPIKey(key); err != nil { return "", err