summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2025-09-18 11:40:55 -0400
committerVictor Kareh <[email protected]>2025-09-18 19:08:33 +0000
commit7e7baca66d1da49d26fd22c923e8787f85597e76 (patch)
treed0bada28d82cc71328ba5a492c62afd43aeb8f76
parent674f9adebe5545e8ad1618ede85a4134420701d7 (diff)
downloadlibmateweather-7e7baca66d1da49d26fd22c923e8787f85597e76.tar.bz2
libmateweather-7e7baca66d1da49d26fd22c923e8787f85597e76.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 7bc24fc..4698a07 100644
--- a/libmateweather/weather-metar.c
+++ b/libmateweather/weather-metar.c
@@ -510,7 +510,7 @@ metar_finish (SoupSession *session, SoupMessage *msg, gpointer data)
loc = info->location;
- searchkey = g_strdup_printf ("<raw_text>%s", loc->code);
+ searchkey = g_strdup_printf ("<raw_text>METAR %s", loc->code);
p = strstr (msg->response_body->data, searchkey);
g_free (searchkey);
if (p) {
@@ -550,7 +550,7 @@ metar_start_open (WeatherInfo *info)
}
msg = soup_form_request_new (
- "GET", "https://aviationweather.gov/cgi-bin/data/dataserver.php",
+ "GET", "https://aviationweather.gov/api/data/dataserver",
"dataSource", "metars",
"requestType", "retrieve",
"format", "xml",