summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2025-09-18 07:31:12 -0400
committerLuke from DC <[email protected]>2025-09-18 17:41:07 +0000
commit0e881958caf4679dcd79e99e4f1a6f8464624e10 (patch)
tree1abe663fe3fe1e1ec66e1570b2c6265bee6c003d
parentc1c54a15545f13f3dabd2bcd303533d818905c7b (diff)
downloadlibmateweather-0e881958caf4679dcd79e99e4f1a6f8464624e10.tar.bz2
libmateweather-0e881958caf4679dcd79e99e4f1a6f8464624e10.tar.xz
metar: Update AviationWeather URL
According to their website: "The AviationWeather Data API has been redeveloped in 2025." Also they put 'METAR' (or 'SPECI') onto the beginning of data to make it ICAO compliant, so we add code to parse that. Fixes #135
-rw-r--r--libmateweather/weather-metar.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libmateweather/weather-metar.c b/libmateweather/weather-metar.c
index d470822..dabca3a 100644
--- a/libmateweather/weather-metar.c
+++ b/libmateweather/weather-metar.c
@@ -523,7 +523,7 @@ metar_finish (GObject *source, GAsyncResult *result, gpointer data)
loc = info->location;
- searchkey = g_strdup_printf ("<raw_text>%s", loc->code);
+ searchkey = g_strdup_printf ("<raw_text>METAR %s", loc->code);
response_body = g_bytes_get_data (bytes, &len);
end = response_body + len;
@@ -578,7 +578,7 @@ metar_start_open (WeatherInfo *info)
"stationString", loc->code,
NULL);
msg = soup_message_new_from_encoded_form (
- "GET", "https://aviationweather.gov/cgi-bin/data/dataserver.php",
+ "GET", "https://aviationweather.gov/api/data/dataserver",
query);
soup_session_send_and_read_async (info->session, msg, G_PRIORITY_DEFAULT,
NULL, metar_finish, info);