ea1f25
From 3df75414d865829274ddc64d30ada98ca08fba3b Mon Sep 17 00:00:00 2001
ea1f25
From: Bastien Nocera <hadess@hadess.net>
ea1f25
Date: Thu, 7 Jan 2021 15:14:40 +0100
ea1f25
Subject: [PATCH 3/7] metno: Use compat 2.0 API
ea1f25
ea1f25
Version 1.9, which we were using, was deprecated and will be removed soon,
ea1f25
so migrate to the compat XML output of the v2.0 API.
ea1f25
ea1f25
Closes: #65
ea1f25
---
ea1f25
 libgweather/weather-yrno.c | 6 +++---
ea1f25
 1 file changed, 3 insertions(+), 3 deletions(-)
ea1f25
ea1f25
diff --git a/libgweather/weather-yrno.c b/libgweather/weather-yrno.c
ea1f25
index d01075bf..7a46fbae 100644
ea1f25
--- a/libgweather/weather-yrno.c
ea1f25
+++ b/libgweather/weather-yrno.c
ea1f25
@@ -37,7 +37,7 @@
ea1f25
 
ea1f25
 #define XC(t) ((const xmlChar *)(t))
ea1f25
 
ea1f25
-/* Reference for symbols at http://om.yr.no/forklaring/symbol/ */
ea1f25
+/* Reference for symbols at https://api.met.no/weatherapi/weathericon/2.0/ */
ea1f25
 typedef struct {
ea1f25
     int code;
ea1f25
     GWeatherSky sky;
ea1f25
@@ -589,12 +589,12 @@ yrno_start_open_new (GWeatherInfo *info)
ea1f25
     if (!loc->latlon_valid)
ea1f25
 	return FALSE;
ea1f25
 
ea1f25
-    /* see the description here: https://api.met.no/ */
ea1f25
+    /* see the description here: https://api.met.no/weatherapi/locationforecast/2.0/documentation */
ea1f25
 
ea1f25
     g_ascii_dtostr (latstr, sizeof(latstr), RADIANS_TO_DEGREES (loc->latitude));
ea1f25
     g_ascii_dtostr (lonstr, sizeof(lonstr), RADIANS_TO_DEGREES (loc->longitude));
ea1f25
 
ea1f25
-    url = g_strdup_printf("https://api.met.no/weatherapi/locationforecast/1.9/?lat=%s;lon=%s", latstr, lonstr);
ea1f25
+    url = g_strdup_printf("https://api.met.no/weatherapi/locationforecast/2.0/classic?lat=%s;lon=%s", latstr, lonstr);
ea1f25
 
ea1f25
     message = soup_message_new ("GET", url);
ea1f25
     _gweather_info_begin_request (info, message);
ea1f25
-- 
ea1f25
2.30.2
ea1f25