SRU api used by xfce4-weather-applet has changed

Bug #1382532 reported by Carey Underwood
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Xfce4 Weather Plugin
Confirmed
Medium
xfce4-weather-plugin (Ubuntu)
New
Undecided
Unassigned

Bug Description

Weather.com has disabled their old API; patch is available upstream.

Revision history for this message
In , Frank McCormick (fmccormick) wrote :

(wrapper:23148): weather-WARNING **: Met.no LocationforecastLTS API states that this version of the webservice is deprecated, and the plugin needs to be adapted to use a newer version, or it will stop working within a few month. Please file a bug on https://bugzilla.xfce.org if no one else has done so yet.
weather-Message: getting http://api.yr.no/weatherapi/locationforecastlts/1.1/?lat=45.500000;lon=-73.583298;msl=82

Revision history for this message
In , Guy (guy-b) wrote :

The same here on xubuntu 12.04 LTS seens 3 days.

Revision history for this message
In , Harald Judt (hjudt) wrote :

Thanks for reporting. If I haven't missed anything, a patch will be quite trivial, as there are not many API changes. Probably simply changing the URL will suffice. I'll try and test soon.

Revision history for this message
In , Guy (guy-b) wrote :

Thanks Harald,

I think too that's only a url problem. Let us know...

Cheers.

Revision history for this message
In , Harald Judt (hjudt) wrote :

Simply using the new URL will not help.

The updated API version uses CamelCase symbol names instead of UPPERCASE
ones and has added some new names (like 'Drizzle'), which unfortunately
have not been documented (yet?).

What's more, the typo 'celcius' has been replaced by the fixed 'celsius',
which has not been documented too, but luckily the plugin will not be affected by that change.

Making symbol names uppercase is trivial, and very probably I can map the new symbol names to existing ones so they can be represented by existing icon themes. I have contacted met.no for more information so I can work on those patches.

Revision history for this message
In , Harald Judt (hjudt) wrote :

Created attachment 5509
make-plugin-ready-for-met.no-locationforecast-1.2-API.patch

I have not received any replies from met.no yet, and though not much time has passed, I'm not very convinced I will. Nevertheless, I have created patches to deal with this problem, it would be great if someone could try them and verify that the results look sane.

The first one prepares the plugin for the new API 1.2, but still uses the old version 1.1. After applying this patch, you should see no differences to an unpatched plugin.

The second patch then switches to the new API 1.2. If you do an immediate comparison, you will probably notice differences in the forecasts, because the new API seems to produce different results than 1.1. If not, you will at least find that the WARNING no longer appears.

While I have tried to match the symbols as good as possible and these patches should keep the 0.8.3 plugin going for some while longer, I have decided to switch to openweathermap for the next feature release. Openweathermap has many benefits, many other clients use it and it has good documentation, especially in comparison to met.no.

At the moment, it is not advised to compile and use current git because there are problems with the update code, noticeable in sunrise/sunset values after 24 hours usage, though there should be no other issues and no crashes. I'm not sure if I will ever fix this, since I'll have to throw away code for openweathermap. Maybe I'll release a stable 0.8.4 (basically 0.8.3 with bug fixes but without new features) if I get to it before working on the provider switch, but I can't promise that.

Revision history for this message
In , Harald Judt (hjudt) wrote :

Created attachment 5510
switch-to-met.no-locationforecastlts-1.2-api.patch

Only usable after applying patch #5509.

Revision history for this message
In , Guy (guy-b) wrote :

Thank you Harald for your work and patches. I would like to try them but I don't know how to patch them. If you could explain it shortly I will do it.

Revision history for this message
In , Harald Judt (hjudt) wrote :

In short, you would have to build the plugin yourself, applying the patches before compiling. I won't have time to help you with this, but if you're interested you can find instructions in the README. However, if you haven't done this before, you will probably need to seek help elsewhere.

Meanwhile I have got an answer from met.no. They have documented the new symbols on another of their many web pages, so I will create a new, more complete patch soon, making attachment #5509 obsolete. They have also told me they will fix the other issues that they haven't been aware of until now.

Revision history for this message
In , Harald Judt (hjudt) wrote :
Revision history for this message
In , Harald Judt (hjudt) wrote :

Leaving this bug report open until a new version has been released.

Revision history for this message
In , Guy (guy-b) wrote :

Created attachment 5525
Screenshot

Revision history for this message
In , Guy (guy-b) wrote :

Comment on attachment 5525
Screenshot

Does it mean that you will do an 8.4 version ?

I take the opportunity to say that the forecasts window doesn't enlarge enough to see all the informations (font), the size is 14 here.

Revision history for this message
In , Harald Judt (hjudt) wrote :

<email address hidden>: Please do not hijack bug reports.

Revision history for this message
In , Mikejani (mikejani) wrote :

(In reply to Harald Judt from comment #6)
> it would be great if someone could try them and verify that
> the results look sane.

Harald, I built the 0.8.3 source from http://archive.xfce.org/src/panel-plugins/xfce4-weather-plugin/0.8/ with the two patches you supplied for the 1.2 API. Both patches applied successfully, however the patches were all offset by quite a few lines.

I've been using the newly built plugin for several days now and have noticed no adverse behavior. The prior warnings about met.no versions are gone and all features appear to be working properly.

Revision history for this message
In , Sean Davis (bluesabre) wrote :

I can also verify that these patches work as expected.

Revision history for this message
In , Evangelos Foutras (foutrelis) wrote :

Just noting that the old API version was disabled a couple of days ago so a new release would be great.

Revision history for this message
In , GVS (gvscheik1-g) wrote :

One can download the 0.8.3-2 version deb or rpm file from:

http://pkgs.org/download/xfce4-weather-plugin

It works fine on 14.04 of Xubuntu, which is all I have tried it on.

Revision history for this message
In , John Thompson (johndthompson) wrote :

Is there a patched source tarball available someplace? The binary packages for 0.8.3.2 have unresolved dependencies on my Ubuntu-12.0.4 and Centos-6.3 machines.

Revision history for this message
In , stefano (rospolosco) wrote :

@JohnThompson

You can download the latest source codewith this command on terminal:

git clone git://git.xfce.org/panel-plugins/xfce4-weather-plugin

then

cd xfce4-weather-plugin

sh autogen.sh

Even if it says to type 'make', I suggest to type:

./configure --prefix=/usr

bacause its default prefix is /usr/local. If your XFCE installation is
in /usr/local dont' need to run configure

I compiled it today 2014-10-13 on Salckware 14.1 because it stopped to work (no data error).

Now it works again. Thanks developers for patching it.

Revision history for this message
In , John Thompson (johndthompson) wrote :

Thanks... I found a src.rpm on the Fedora "Koji" site, used rpmbuild to patch the source tree and build my Centos rpm, then "make distclean" to clean out the binaries from the patched source tree, tarred up the patched sources and copied to my Ubuntu machine. Then "./configure --prefix=/usr" and "checkinstall -D" to build a Debian package. Installed the new package and all is well again...

Revision history for this message
In , Harald Judt (hjudt) wrote :

Please beware that the current git version still has a bug in the update routine, I've already mentioned that above. Nothing too bad, it won't make anything crash, but the sunrise/sunset dates and therefore night time status will not be updated correctly (which you might only notice after a day, and then probably not every time). Refreshing the data manually via the context menu or a middle-click on the panel widget might solve this too.

I've only noticed a few moments ago there have already been a lot of changes since 0.8.3. I'm currently investigating into this bug, but debugging and testing takes time due to the nature of the bug. I'm not sure I will find a clean solution quickly, but if I can work around my bad design of the update routine, then I'll do a dirty fix and release 0.8.4. Could take a week, or maybe even a month, depending on what other stuff steals my time...

BTW: If you look at the README and the goodies homepage, you'll find detailed instructions on how to download the source and build the plugin. You can simply apply the two patches from this bug report on 0.8.3, and this way you won't have to care about the update bug at all.

Revision history for this message
Carey Underwood (cwillu) wrote : Upstream patches

Hunk #1 of the first patch needed a trivial change to account for an
added block.

From https://bugzilla.xfce.org/show_bug.cgi?id=10916#c10

Changed in xfce4-weather-plugin:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
dennygoot@gmail.com (dennygoot) wrote :

I still get this as of today (06-18-2016):

Met.no sunrise API states that this version of the webservice
 is deprecated, and the plugin needs to be adapted to use
 a newer version, or it will stop working within a few months.
 Please file a bug on https://bugzilla.xfce.org if no one
 else has done so yet.

This is on Xubuntu 16.04 64 bit.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.