Permalink
Browse files

metar: switch to aviationweather.gov (weather.noaa.gov is discontinued)

1 parent 120bf8d commit 835055e0d0b950d3f66ad236de7e40942f6f7d8e @monsta monsta committed Aug 24, 2016
Showing with 3 additions and 3 deletions.
  1. +3 โˆ’3 libmateweather/weather-metar.c
@@ -522,7 +522,7 @@ metar_finish (SoupSession *session, SoupMessage *msg, gpointer data)
metar = g_strdup (p);
success = metar_parse (metar, info);
g_free (metar);
- } else if (!strstr (msg->response_body->data, "National Weather Service")) {
+ } else if (!strstr (msg->response_body->data, "AVIATION WEATHER CENTER")) {
/* The response doesn't even seem to have come from NWS...
* most likely it is a wifi hotspot login page. Call that a
* network error.
@@ -550,8 +550,8 @@ metar_start_open (WeatherInfo *info)
}
msg = soup_form_request_new (
- "GET", "http://weather.noaa.gov/mgetmetar.php",
- "cccc", loc->code,
+ "GET", "http://aviationweather.gov/metar/data",
+ "ids", loc->code,
NULL);
soup_session_queue_message (info->session, msg, metar_finish, info);

8 comments on commit 835055e

@flexiondotorg
Member
flexiondotorg commented on 835055e Aug 25, 2016 edited

@monsta In my testing the causes the clock applet and weather applet to segfault. This is with the libmateweather 1.14.1 release from last night.

@flexiondotorg
Member

Ignore the above. My mistake building the package.

@tx0h
tx0h commented on 835055e Aug 26, 2016

why not add a environment variable which could overwrite silly hard coded urls, maybe METAR_URL or something?

@ionutr2015

Thanks, it works great.

@born2webdesign
born2webdesign commented on 835055e Sep 8, 2016 edited

@tx0h That would be a step in the right direction โ€“ but why not make this configurable in the settings?
Either a text input field with a default server or a dropdown list of preconfigured servers (preferably with the option to add more servers)? For a simpler option, maybe at least a config file?
https://developer.yahoo.com/weather/ looks promising?
Or regional services like http://wetter-api.de

@monsta
Member
monsta commented on 835055e Sep 12, 2016

If you look at the next commit, c1b7189 (which switches to recommended method of data retrieval), you'd see the usage of API that's specific to that server. Could you find some other server that uses exactly the same API?

@goetzc
Contributor
goetzc commented on 835055e Sep 12, 2016

The comment on this commit said that libgweather added yahoo as a provider c8a7ad7. It also seems that it uses Geocode to find the location automatically.

Would it be feasible to use libgweather instead of libmateweather?

@monsta
Member
monsta commented on 835055e Sep 13, 2016 edited

Yes, I have that in my plans, but only after mate-panel and mate-applets will be built with GTK+3 only.

Please sign in to comment.