After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 467697 - Forecasts broken for UK
Forecasts broken for UK
Status: RESOLVED OBSOLETE
Product: libgweather
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: 2.24.0
Assigned To: libgweather-maint
libgweather-maint
: 529121 539148 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-08-17 15:52 UTC by Ray Strode [halfline]
Modified: 2014-02-18 23:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Updates URL and tweaks parsing (19.42 KB, patch)
2010-08-14 18:40 UTC, Dave Kilroy
none Details | Review
Translate ° (835 bytes, patch)
2010-08-14 18:44 UTC, Dave Kilroy
none Details | Review
Updates URL and tweaks parsing v2 (19.42 KB, patch)
2010-08-16 19:12 UTC, Dave Kilroy
none Details | Review
Translate ° v2 (775 bytes, patch)
2010-08-16 19:15 UTC, Dave Kilroy
none Details | Review

Description Ray Strode [halfline] 2007-08-17 15:52:24 UTC
(from David Woodhouse, https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=184366)

The weather applet tells me that no forecast is available.
Comment 1 Ray Strode [halfline] 2007-08-17 15:53:49 UTC
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.
Comment 2 David Woodhouse 2007-08-19 11:25:18 UTC
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
Comment 3 Dan Winship 2008-06-18 17:35:40 UTC
Moving libgweather-specific bugs out of gweather-applet
Comment 4 Dan Winship 2008-06-18 18:55:13 UTC
*** Bug 529121 has been marked as a duplicate of this bug. ***
Comment 5 Vincent Untz 2008-11-27 14:01:18 UTC
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).

Comment 6 Vincent Untz 2008-11-27 14:01:33 UTC
*** Bug 539148 has been marked as a duplicate of this bug. ***
Comment 7 Dave Kilroy 2010-08-14 18:40:15 UTC
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.
Comment 8 Dave Kilroy 2010-08-14 18:44:10 UTC
Created attachment 167882 [details] [review]
Translate &deg;

The met office uses '&deg;C' in its' forecasts. This is untidy in gweather-applet-2. I've attached a patch translating '&deg;' to '^'.

Would be better to translate to the correct UTF8/UTF16, but I don't know the right incantations.
Comment 9 David Woodhouse 2010-08-14 19:15:23 UTC
*o++ = 0xc2; *o++ = 0xb0;
Comment 10 Dave Kilroy 2010-08-15 17:09:05 UTC
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).
Comment 11 Dave Kilroy 2010-08-16 19:12:59 UTC
Created attachment 167998 [details] [review]
Updates URL and tweaks parsing v2

Correct Welsh zone
Comment 12 Dave Kilroy 2010-08-16 19:15:05 UTC
Created attachment 167999 [details] [review]
Translate &deg; v2

Use UTF8. Confirmed gweather-applet-2 displays forecast correctly.
Comment 13 Michael Wood 2010-09-14 15:03:25 UTC
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?
Comment 14 Giovanni Campagna 2014-02-18 23:11:22 UTC
libgweather removed support for textual forecasts some time ago. Closing.