[libgweather/wip/hadess/met-no-migration: 6/6] metno: Use compat 2.0 API




commit 2c187a74c575d7c32535ff1db2206cbf7a045ffb
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Jan 7 15:14:40 2021 +0100

    metno: Use compat 2.0 API
    
    Version 1.9, which we were using, was deprecated and will be removed soon,
    so migrate to the compat XML output of the v2.0 API.
    
    Closes: #65

 libgweather/weather-metno.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/libgweather/weather-metno.c b/libgweather/weather-metno.c
index 81b14463..eaa48b1d 100644
--- a/libgweather/weather-metno.c
+++ b/libgweather/weather-metno.c
@@ -37,7 +37,7 @@
 
 #define XC(t) ((const xmlChar *)(t))
 
-/* Reference for symbols at http://om.yr.no/forklaring/symbol/ */
+/* Reference for symbols at https://api.met.no/weatherapi/weathericon/2.0/ */
 typedef struct {
     int code;
     GWeatherSky sky;
@@ -444,12 +444,12 @@ metno_start_open (GWeatherInfo *info)
     if (!loc->latlon_valid)
        return FALSE;
 
-    /* see the description here: https://api.met.no/ */
+    /* see the description here: https://api.met.no/weatherapi/locationforecast/2.0/documentation */
 
     latstr = _radians_to_degrees_str (loc->latitude);
     lonstr = _radians_to_degrees_str (loc->longitude);
 
-    url = g_strdup_printf("https://api.met.no/weatherapi/locationforecast/1.9/?lat=%s;lon=%s";, latstr, 
lonstr);
+    url = g_strdup_printf("https://api.met.no/weatherapi/locationforecast/2.0/classic?lat=%s;lon=%s";, 
latstr, lonstr);
     g_debug ("metno_start_open, requesting: %s", url);
 
     message = soup_message_new ("GET", url);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]