[libgweather/wip/hadess/met-no-fixes: 1/2] metno: Use GNOME-specific subdomain
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgweather/wip/hadess/met-no-fixes: 1/2] metno: Use GNOME-specific subdomain
- Date: Tue, 12 Jan 2021 13:26:08 +0000 (UTC)
commit 44d042336f9439ca3b341b5bcb44c55a3384fa66
Author: Bastien Nocera <hadess hadess net>
Date: Tue Jan 12 14:21:21 2021 +0100
metno: Use GNOME-specific subdomain
This allows the API provider to track libgweather usage.
libgweather/weather-metno.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/libgweather/weather-metno.c b/libgweather/weather-metno.c
index 552e6b9d..94d35d69 100644
--- a/libgweather/weather-metno.c
+++ b/libgweather/weather-metno.c
@@ -37,6 +37,9 @@
#define XC(t) ((const xmlChar *)(t))
+/* As per https://gitlab.gnome.org/GNOME/libgweather/-/issues/59#note_1004747 */
+#define API_ENDPOINT_DOMAIN "aa037rv1tsaszxi6o.api.met.no"
+
/* Reference for symbols at https://api.met.no/weatherapi/weathericon/2.0/ */
typedef struct {
int code;
@@ -441,7 +444,7 @@ metno_start_open (GWeatherInfo *info)
latstr = _radians_to_degrees_str (loc->latitude);
lonstr = _radians_to_degrees_str (loc->longitude);
- url = g_strdup_printf("https://api.met.no/weatherapi/locationforecast/2.0/classic?lat=%s;lon=%s",
latstr, lonstr);
+ url = g_strdup_printf("https://" API_ENDPOINT_DOMAIN
"/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]