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 628750 - libgweather / weather-applet can no longer can no longer retrieve forecast data for locations parsing data from bom.gov.au
libgweather / weather-applet can no longer can no longer retrieve forecast da...
Status: RESOLVED FIXED
Product: libgweather
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: 2.22.0
Assigned To: libgweather-maint
libgweather-maint
Depends on:
Blocks:
 
 
Reported: 2010-09-04 02:34 UTC by Luke
Modified: 2015-11-20 06:02 UTC
See Also:
GNOME target: ---
GNOME version: 2.29/2.30


Attachments
Untested patched weather-bom.c. Note that this should be tested by someone who knows how to recompile the libgweather source. (2.11 KB, text/plain)
2010-09-04 02:34 UTC, Luke
  Details
weather-bom.c patch (1.04 KB, patch)
2010-09-09 13:31 UTC, Johnny
committed Details | Review

Description Luke 2010-09-04 02:34:54 UTC
Created attachment 169462 [details]
Untested patched weather-bom.c. Note that this should be tested by someone who knows how to recompile the libgweather source.

-----------------------------------
Issue Description
-----------------------------------

In relation to "weather-applet" and "libgweather" - over the past several months, the Australian Bureau of Meteorology (BOM) has updated its website to deliver a HTML forecast page for a number of locations around Australia.

Currently - the <zone> tag from "Locations.xml" is used within "weather-bom.c" to retrieve information from the appropriate bom.gov.au URL which if successful is then parsed in the "bom_parse" function.

With the new HTML forecast pages for various locations however, the data can not be successfully parsed and instead the message "Forecast not currently available for this location." shows up on the Forecast tab of weather-applet.

-----------------------------------
Area of Interest
-----------------------------------

Within "weather-bom.c" - the following line of code points to URLs (depending on location) that now have HTML forecast data rather than plain text...

    url = g_strdup_printf ("http://www.bom.gov.au/cgi-bin/wrap_fwo.pl?%s.txt",
      loc->zone + 1);

-----------------------------------
Suggested Fix
-----------------------------------

I suggest/propose that the URL above be changed to point to plain text documents on the BOM FTP server (ftp://ftp2.bom.gov.au/anon/gen/fwo/) with the appropriate weather station zone variable.

i.e. Using "ftp://ftp2.bom.gov.au/anon/gen/fwo/%s.txt" as the URL to parse. For Sydney (Zone IDN10064, which would be used as %s) - currently the code would point to:

http://www.bom.gov.au/cgi-bin/wrap_fwo.pl?IDN10064.txt

However this is now a HTML forecast (despite the URL ending with .txt!), which causes the issue noted above... by pointing the code to the new URL to parse:

ftp://ftp2.bom.gov.au/anon/gen/fwo/IDN10064.txt

The plain text version of the forecast can be used without any modification to the other functions/aspects of the code.

-----------------------------------
Patches - Untested!
-----------------------------------

Please see the attached "weather-bom.c" which includes the suggested fix (i.e. patched version). Note it will need to be/should be tested by someone who knows how to recompile the libgweather source.

-----------------------------------
Notes
-----------------------------------

* This bug has also been reported on launchpad for Ubuntu:

https://bugs.launchpad.net/ubuntu/+source/libgweather/+bug/629646

It was reported here since all distributions of GNOME using the current bom.gov.au for data parsing will be affected.

* Note that some locations may not yet experience the issue since BOM are in the process of migrating numerous locations to HTML formatted forecasts. It would be a better idea to point to the actual plain text documents as noted above however since the existing URL's format can change at any time.

* Thank you to whoever fixes this - it's a small but annoying bug that when fixed should benefit all Australian users of libgweather/weather-applet - so I'm sure it will be much appreciated when fixed! Cheers!

---------------------------------------------------------------------------------------------------------
System information
---------------------------------------------------------------------------------------------------------
Description: Ubuntu 10.04.1 LTS
Release: 10.04

libgweather-common:
  Installed: 2.30.0-0ubuntu1
  Candidate: 2.30.0-0ubuntu1
  Version table:
 *** 2.30.0-0ubuntu1 0
        500 http://ftp.iinet.net.au/linux/ubuntu/ lucid/main Packages
        100 /var/lib/dpkg/status
---------------------------------------------------------------------------------------------------------
Comment 1 Johnny 2010-09-09 13:31:41 UTC
Created attachment 169852 [details] [review]
weather-bom.c patch
Comment 2 Johnny 2010-09-09 13:32:28 UTC
I am attaching a patch which works for me.
Comment 3 Rodd Clarkson 2010-09-24 10:44:49 UTC
I can confirm this on Fedora 13. I can't confirm the patch fixes it but it's worth a try as it's currently not working.  ;-]
Comment 4 Andrew Cowie 2010-11-17 00:16:48 UTC
I can confirm that this has been going on during both GNOME 2.30 and now GNOME 2.32 at (in my case) Sydney.

AfC
Comment 5 David Clayton 2010-12-01 04:46:46 UTC
I'd like to BEG that this minor fix is committed and a new version be made available ASAP, I've been suffering without this handy feature for quite a while now and it seems like the solution has been served up on the proverbial platter.
Comment 6 David Clayton 2010-12-03 05:40:51 UTC
(In reply to comment #1)
> Created an attachment (id=169852) [details] [review]
> weather-bom.c patch

I patched the libgweather-2-23.0 source with this patch, did a ./configure and then a "sudo checkinstall" but it still does not work for me. Did I miss something?
Comment 7 David Clayton 2010-12-03 05:52:10 UTC
Review of attachment 169852 [details] [review]:

Patch works for me (once I figured out that my compilation process put the new libs in /usr/local/lib rather than /usr/lib).
Comment 8 Luke 2010-12-03 05:56:47 UTC
Hey David,

Great to hear the patch works for you. What OS are you using? Would you mind posting instructions on how you implemented the patch?

Whilst I am the author of this bug report and came up with a patch (though not as elegant as "Johnny"'s patch) - I have no actual idea how to implement it.

I'm sure it will help all of those affected until (if?) the patch is committed/fixed.
Comment 9 David Clayton 2010-12-03 06:07:59 UTC
This is what I used: http://askubuntu.com/questions/14271/instructions-on-how-to-recompile-the-libgweather-source

You have to download and install piles of packages - as well as the libgweather source - to create the new .deb which is then installed. I then had to manually copy the new lib files as per my Review post.
Comment 10 David Clayton 2010-12-03 06:08:39 UTC
Whoops, on Ubuntu 10.04.
Comment 11 Michael Chapman 2010-12-09 05:21:15 UTC
This bug appears to be a duplicate of #619152. Neither bug appears to be seeing much action from the gnome-applets maintainers, however.
Comment 12 BiNH 2011-01-01 22:58:08 UTC
This patch works, would someone apply it upstream??
Comment 13 Glenn Moloney 2011-01-20 23:18:30 UTC
Yes confirmed as well that the patch works (Tested on Ubuntu 10.04) . As above could someone please upstream it??? Thank you
Comment 14 David Clayton 2011-10-21 05:25:15 UTC
Still there in Ubuntu 11.10 - is there something stopping this TRIVIAL fix being implemented?
Comment 15 Vincent Untz 2011-10-24 14:10:19 UTC
Comment on attachment 169852 [details] [review]
weather-bom.c patch

Unfortunately, there's no real active maintainer for libgweather at the moment, so this was waiting for way too long :/
Comment 16 Vincent Untz 2011-10-24 14:10:49 UTC
I changed the code a bit to remove extra test we don't care about.
Comment 17 Johnny 2011-10-24 23:31:14 UTC
Thanks for finally committing this and promptly releasing it :)
Comment 18 Luke 2011-10-25 00:04:51 UTC
Yes, wow, thank you Vincent Untz and anyone else who was involved (Tobias Mueller?)!

Good to see that open source works, even if it took a tad over a year, the fact it can be resolved and has been is great :)

Thank you again.
Comment 19 David Clayton 2015-11-20 06:02:41 UTC
Bug seems to have returned to Ubuntu 15.10 using libgweather 3.16.1-1ubuntu1

No Australian forecast data for Melbourne location.