GNOME Bugzilla – Bug 467697
Forecasts broken for UK
Last modified: 2014-02-18 23:11:22 UTC
(from David Woodhouse, https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=184366) The weather applet tells me that no forecast is available.
I looked into this a little bit and posted what I found out here: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=184366#c7 Repasted here: So there are a few problems it looks like: First, the url changed. gweather applet tries to go to: http://www.metoffice.gov.uk/weather/europe/uk/eastern.html for cambridge, but the new url is: http://www.metoffice.gov.uk/weather/uk/ee/ee_forecast_weather.html (as you point out above) If I go to the first url in firefox it takes me to the second url. gnome_vfs_async_open just returns NOT_FOUND, however, for the first url instead of redirecting. /usr/bin/HEAD doesn't mention any sort of redirect so something strange is going on, but I haven't looked too deeply. Aside from that, the actual content of the page has changed as well. It now stores the forecast in some weird javascript/dhtml setup that's harder to screen-scrape.
Perhaps the BBC version would be better. They seem to be better set up for it, with RSS feeds etc. http://www.bbc.co.uk/weather/5day.shtml?id=1413 http://feeds.bbc.co.uk/weather/feeds/rss/5day/id/1413.xml
Moving libgweather-specific bugs out of gweather-applet
*** Bug 529121 has been marked as a duplicate of this bug. ***
In bug 539148, Bastien gives some other useful URLs. Quoting: For example: http://www.bbc.co.uk/weather/5day.shtml?id=2051 Offers 5-day, and one-day forecasts RSS feeds for UK locations. In the RSS feed, you can see: <geo:lat>51.27</geo:lat> <geo:long>-0.77</geo:long> Unfortunately, there's no list of cities, and the T&Cs might make this unusable: http://www.bbc.co.uk/weather/bbcweather/features/RSS_termsandconditions.shtml The MetOffice offers some more data. The data is offered as plain text files: http://www.metoffice.gov.uk/gadgets/datafiles/ukobs/london.txt Or from http://www.metoffice.gov.uk/gadgets/datafiles/ukobs/southfarnborough.txt: 03768|SOUTH FARNBOROUGH|51.27|-0.77|London & South East England|1500|19/06/2008|WSW|18|-99|30000|19.6|6.2|1011|R|1|-99|0.0|42|0|2500|-99|-99|-99|-99|1 The full list of locations is available in the Windows Gadget sources (javascript/moweathersettings.js) and how the filenames are created (WarningsWatcher.refreshWarning in javascript/indexWatcher.js).
*** Bug 539148 has been marked as a duplicate of this bug. ***
Created attachment 167881 [details] [review] Updates URL and tweaks parsing Attaching a patch that restores forecast information for the UK. Uses the met office data at http://www.metoffice.gov.uk/. Tested with gweather-applet-2. Only includes the 2 day forecast. Comments within the patch indicate where further forecast info can be retrieved.
Created attachment 167882 [details] [review] Translate ° The met office uses '°C' in its' forecasts. This is untidy in gweather-applet-2. I've attached a patch translating '°' to '^'. Would be better to translate to the correct UTF8/UTF16, but I don't know the right incantations.
*o++ = 0xc2; *o++ = 0xb0;
Thanks. I noticed my first patch gets the zone for Wales wrong. It should be :wl rather than :wa (there are 4 occurrences of this).
Created attachment 167998 [details] [review] Updates URL and tweaks parsing v2 Correct Welsh zone
Created attachment 167999 [details] [review] Translate ° v2 Use UTF8. Confirmed gweather-applet-2 displays forecast correctly.
Thanks for the patch(es) they work well, would be useful to commit this until we have a better data source. I think using the BBC feed would be good, much more useful info in it too (and easier to parse). Aslong as there was a way to link back to the BBC weather site it should be fine with the licence?
libgweather removed support for textual forecasts some time ago. Closing.