mate-desktop / libmateweather

Library to access weather information from online services
https://mate-desktop.org
GNU Lesser General Public License v2.1
21 stars 24 forks source link

Weather still not fully sorted #33

Closed NuxRo closed 8 years ago

NuxRo commented 8 years ago

Apparently forecasting is still broken, see this user's message https://lists.centos.org/pipermail/centos/2016-August/160898.html

It's for Gnome2, but broken on MATE, too:

grep -Ri "weather.noaa" *
ChangeLog:    update weather.noaa.gov url
ChangeLog:    update weather.noaa.gov url
libmateweather/weather-metar.c: "GET", "http://weather.noaa.gov/mgetmetar.php",
libmateweather/weather-iwin.c:    url = g_strdup_printf ("http://weather.noaa.gov/pub/data/forecasts/zone/%s/%s.txt", state, zone);
monsta commented 8 years ago

This forecast seems to be for US only, so I can't test it (also - which app uses it?)

Anyway, I'd simply replace http://weather.noaa.gov/pub/data with http://tgftp.nws.noaa.gov/data (yes, there's no pub in URL). That server seems to have the same info.

NuxRo commented 8 years ago

This app http://tmp.nux.ro/JJ7-weatherapp.mp4

Will give your suggestion a go when I get the chance next.

monsta commented 8 years ago

Ah... so it's just the weather applet, I didn't realize it had the forecast tab there. That tab was never shown to me due to unsupported location (I'm in Russia).

NuxRo commented 8 years ago

Did what you suggested, it still doesn't work for London, but switched my location to New York and I could get some forecast.

Wonder what that http://weather.noaa.gov/mgetmetar.php is doing in weather-metar.c though and what stuff it breaks.

Would it be difficult to switch to YR.NO? They seem to cover much more locations.

monsta commented 8 years ago

Wonder what that http://weather.noaa.gov/mgetmetar.php is doing in weather-metar.c though and what stuff it breaks.

It's not there anymore after https://github.com/mate-desktop/libmateweather/commit/835055e0d0b950d3f66ad236de7e40942f6f7d8e. Forecast-related code is in libmateweather/weather-iwin.c anyway.

Would it be difficult to switch to YR.NO? They seem to cover much more locations.

If anyone is willing to analyze the format of their data and make the necessary changes to the source code, I'm fine with it.

monsta commented 8 years ago

I see the guy at https://ubuntu-mate.community/t/weather-applets-inop/8435/43 claims the new forecast URL is working for him. I can't find which location he's in though.

NuxRo commented 8 years ago

Monsta, it works for USA locations at least, try to set your applet to some of their cities and it'll work with the fix you suggested (confirmed also by the ubuntu user). It doesn't work for the rest of the world.

monsta commented 8 years ago

You mentioned it doesn't work for London - did it work with the old server?

NuxRo commented 8 years ago

I never checked, always used the BBC weather site for forecasting. I only looked into it because the other guy with Fedora 24 was complaining. :)

monsta commented 8 years ago

Ok, I'll wait for replies from guys from Ubuntu MATE community, maybe we'll get more test results. However, I don't think there's much choice here... we're offered only one replacement server that can be used without changing too much code (like it would be with Norwegian provider or any others out there).

NuxRo commented 8 years ago

True, I think your suggested solution fixes this issue, let's close it and what will be will be.

monsta commented 8 years ago

Wait, I didn't apply the patch yet in the repo :smile:

goetzc commented 8 years ago

Is this fix in some branch?

monsta commented 8 years ago

Now it is, in master and 1.14 (and version 1.14.3 is released).