Bug 379003 - Wallpaper "Picture of the Day" from National Geographics only changing after reboot or not at all.
Summary: Wallpaper "Picture of the Day" from National Geographics only changing after ...
Status: RESOLVED FIXED
Alias: None
Product: Plasma Workspace Wallpapers
Classification: Plasma
Component: general (show other bugs)
Version: 5.9.4
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Development Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-20 14:59 UTC by Christian
Modified: 2017-07-10 23:31 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
NatGeo POTD patch (2.26 KB, patch)
2017-05-06 01:45 UTC, Juri Vitali
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian 2017-04-20 14:59:10 UTC
I have had Picture of the Day from National Geographics set since I installed Neon User Edition a couple of months ago. It worked for a while but mostly changed after logout/in or after reboot. Sometimes after 48 hours or more, never after 24 hours, but now not at all. The same wallpaper has been set for 10 days or so. Reboot doesn't trigger and update. I have checked the National Geographics site and the picture of the day has change several times since the one I've got was issued.
Comment 1 Duncan 2017-04-20 20:56:19 UTC
I run live-git plasma and frameworks via the gentoo/kde overlay, and saw this on the plasma-devel list, which I follow.

The NatGeo PotD module seems to be broken, ATM, and doesn't work for me either. =:^(

AFAIK, the change is on the NatGeo side, probably either a change to their POTD URL/page so the plasma natgeo-potd module doesn't pick it up any longer, or possibly it's their firewall interpreting all these automated update queries as abuse and blocking them based on for instance number of queries within N hours from the same IP address (would still work for new users for a short time), or on useragent (would be broken for all plasma users), or something else from the queries they can log and block.

I hope it can be updated to fix the problem, but if it is indeed a NatGeo firewall block, any fix is likely to be temporary, unless it's actually coordinated with the NatGeo website folks.

But FWIW, the bing PotD is now working.  When I first noticed it, attempting to select and apply would crash plasmashell and attempting to restart would would only crash it again, until the config file was manually edited to point to something other than the bing potd.  I saw a recent commit that said it should fix that, and indeed, now the bing potd actually works.  =:^)

Well at least you know it's not only you, now.
Comment 2 Christian 2017-04-21 00:33:44 UTC
Good to know it's not only me, thanks. I still have the problem that the picture isn't changing until I reboot or after more than 24 hours. But that may be a second unrelated bug. We'll see if/when the issue with URL is fixed c
Comment 3 Clemens 2017-04-21 08:43:12 UTC
In my case, it does not work at all.
Even after I reboot, the picture is not available.

Plasma Version 5.9.4
Comment 4 Kai Uwe Broulik 2017-04-21 09:36:42 UTC
We run QXmlStreamReader over the page to find the og:image of the picture.

However, HTML isn't strictly XML and so it chokes on the lines which come before the "og:image" meta tag:

<link rel="preload" href="//fonts.ngeo.com/haas/1-0-0/NHaasGroteskDSPro-55Rg.woff2" as="font" type="font/woff2" crossorigin>

(note the "crossorigin" without a value which isn't valid XML)
Comment 5 Christian 2017-04-21 11:18:48 UTC
(In reply to Clemens from comment #3)
> In my case, it does not work at all.
> Even after I reboot, the picture is not available.
> 
> Plasma Version 5.9.4

I guess I wasn't being clear. Even before it started not working at all it didn't change to the new picture every 24 hours. I either had to reboot or wait for days for it to change. On the lock screen it changed, but not on the desktop without a reboot or after several days. Now it doesn't work at all but I was wondering if the delay or having to reboot could be @a different issue.
Comment 6 Christian 2017-04-21 11:22:31 UTC
(In reply to Kai Uwe Broulik from comment #4)
> We run QXmlStreamReader over the page to find the og:image of the picture.
> 
> However, HTML isn't strictly XML and so it chokes on the lines which come
> before the "og:image" meta tag:
> 
> <link rel="preload"
> href="//fonts.ngeo.com/haas/1-0-0/NHaasGroteskDSPro-55Rg.woff2" as="font"
> type="font/woff2" crossorigin>
> 
> (note the "crossorigin" without a value which isn't valid XML)

Does that mean that Nat Geo POtD won't be available anymore or could it be fixed?
Comment 7 Kai Uwe Broulik 2017-04-21 11:23:59 UTC
We could do some horrible RegExp thing I suppose (oh I already look forward to the outcry how you cannot use regular expressions with XML :P), I'll try to come up with something.
Comment 8 Juri Vitali 2017-05-06 01:45:11 UTC
Created attachment 105363 [details]
NatGeo POTD patch

I implemented a quick and dirty patch to parse the page using QRegularExpression, and it seems to be working (and much faster than before, but that may be just my impression).
Can anyone confirm if this works for someone else too?
Comment 9 Sebastian Kügler 2017-05-06 10:43:40 UTC
Hi Juri,

Great! From a quick glance at the bugreport and the explanation, I don't see another easy way around this. Your patch however, will need a bit of cleanup and proper review. Could you post it to KDE's phabricator, so we can run it through our review process, get it up to our standards and then merge it?

The address is phabricator.kde.org .

Thanks!
Comment 10 Juri Vitali 2017-05-06 13:21:53 UTC
(In reply to Sebastian Kügler from comment #9)

Sure thing!

I cleaned the patch up a bit, and posted it on Phabricator.
Here it is: https://phabricator.kde.org/D5729
Comment 11 Christian 2017-05-09 18:11:14 UTC
As a non-developer I guess I have to wait until this makes it into KDE before I will be able to use the NatGeo wallpaper again?
Comment 12 Sebastian Kügler 2017-05-09 21:52:29 UTC
Possibly, the peach needs reviewing first, and then a call needs to be made of it can be shipped with a bugfix update.

"Makes it into KDE" doesn't mean anything, KDE are the people making software. What you likely mean is Plasma (which is the product this coffee is part of).
Comment 13 Christian 2017-05-10 11:12:24 UTC
It was called the KDE desktop back when I started using Linux so the whole Plasma concept hasn't stuck yet 😊 Good thing out may get into Plasma so I can use this wallpaper option again. Thanks!
Comment 14 Christian 2017-07-10 23:22:34 UTC
Has this patch been reviewed and been made available yet in Neon?
Comment 15 David Edmundson 2017-07-10 23:31:07 UTC
Git commit 4ed05974c6a150677ad3a91578879092486124e2 by David Edmundson, on behalf of Juri Vitali.
Committed on 10/07/2017 at 23:30.
Pushed by davidedmundson into branch 'Plasma/5.10'.

Replace XML parsing in National Geographic dataengine

The current parsing mechanism to obtain the current NatGeo POTD based on
XML is broken, this patch proposes an alternative mechanism using
QRegularExpression library. For this method to continue working in the
future it is supposed that the web page will maintain a sane format,
namely that the relevant tag will not be broken among many lines, the
fields inside the tag will maintain the same relative order, and
obviously that it will not be obfuscated.

Reviewers: sebas, mart

Reviewed By: mart

Subscribers: mart, Zren, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D5729

M  +11   -15   dataengines/potd/natgeoprovider.cpp

https://commits.kde.org/kdeplasma-addons/4ed05974c6a150677ad3a91578879092486124e2