summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2025-09-18 11:40:55 -0400
committerLuke from DC <[email protected]>2025-09-18 17:50:17 +0000
commit80b5f259864f7fecfb3c936f8f9aeade2d327f56 (patch)
treea9a2ce1bc0ee910ca8a5d8cac02b2da684c18798
parentacb8c065992d5f697155e8334c283c8af6abb58f (diff)
downloadlibmateweather-80b5f259864f7fecfb3c936f8f9aeade2d327f56.tar.bz2
libmateweather-80b5f259864f7fecfb3c936f8f9aeade2d327f56.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",