Fix NOAA picture of the day provider
ClosedPublic

Authored by guoyunhe on Oct 17 2019, 12:48 PM.

Details

Summary

The webpage structure of NOAA changed so the old regular expression doesn't work anymore. Updated it. But it can break in future again.

BUG: 408580

Diff Detail

Repository
R114 Plasma Addons
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 17797
Build 17815: arc lint + arc unit
guoyunhe created this revision.Oct 17 2019, 12:48 PM
Restricted Application added a project: Plasma. · View Herald TranscriptOct 17 2019, 12:48 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
guoyunhe requested review of this revision.Oct 17 2019, 12:48 PM
guoyunhe edited the summary of this revision. (Show Details)Oct 17 2019, 12:50 PM
guoyunhe added a reviewer: Plasma.

This doesn't fix the problem for me. :(

This doesn't fix the problem for me. :(

Can you run plasmashell --replace in terminal and check the error output?

guoyunhe updated this revision to Diff 68185.Oct 17 2019, 6:29 PM
guoyunhe edited the summary of this revision. (Show Details)

Change back to the original page URL

Still broken, I'm afraid. Among the console output is the following, which may be helpful:

kf5.kio.core: Invalid URL: QUrl("/sites/default/files/bomb-cycle-1.jpg")

Still broken, I'm afraid. Among the console output is the following, which may be helpful:

kf5.kio.core: Invalid URL: QUrl("/sites/default/files/bomb-cycle-1.jpg")

The url in my patch is QStringLiteral("https://www.nesdis.noaa.gov") + result.captured(1);. So it must begin with https://.

I don't know what to tell you; it's still broken for me. It looks like the first part of the URL isn't getting added onto the second, maybe.

sitter added a subscriber: sitter.EditedOct 18 2019, 10:24 AM

When I put the code in a minimal standalone program I can confirm that the code works just fine. Are you sure your testing methodology is sound @ngraham ?

In point of fact

if (url.isEmpty()) {

should actually be url.isValid because the requirement is not just that it needs to be nonempty but also valid. When changed, that condition would show more clearly that the right code is run as the KIO warning should disappear.

guoyunhe updated this revision to Diff 68225.Oct 18 2019, 10:57 AM

Validate QUrl of image

If it works for you @sitter then feel free to ignore me. But I believe my testing methodology is sound: I'm living in my built-from-source plasma session and I apply the patch, build and install kdeplasma-addons to ~/kde/usr, and then restart plasmashell. This works for testing everything else.

sitter accepted this revision.Oct 18 2019, 2:08 PM

works well enough it seems

This revision is now accepted and ready to land.Oct 18 2019, 2:08 PM
Closed by commit R114:432470576605: Fix NOAA picture of the day provider (authored by Guo Yunhe <i@guoyunhe.me>). · Explain WhyOct 18 2019, 2:11 PM
This revision was automatically updated to reflect the committed changes.