Fetch high-resolution image from Bing
Needs RevisionPublic

Authored by carmenbianca on Aug 23 2018, 7:49 PM.

Details

Summary

When visiting https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1, the URL field of the image is not always 1920x1080. For some reason, Bing serves me different resolutions dependent on my IP address. One easy way to verify this is by loading that site in Tor Browser and refreshing your Tor Circuit a couple of times.

This patch should always download the 1920x1080 image, on the assumption that this resolution is always available and always a JPG. I have not found anything contradicting these assumptions, though.

I'm not very experienced with C++ or KDE development, so I may have messed up this patch. It seems like a simple enough fix, however.

Diff Detail

Repository
R114 Plasma Addons
Lint
Lint Skipped
Unit
Unit Tests Skipped
carmenbianca created this revision.Aug 23 2018, 7:49 PM
Restricted Application added a project: Plasma. · View Herald TranscriptAug 23 2018, 7:49 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
carmenbianca requested review of this revision.Aug 23 2018, 7:49 PM
kossebau resigned from this revision.Aug 23 2018, 8:26 PM

Sorry, I do not have time for Plasma things these months. No maintainer here.

davidedmundson requested changes to this revision.Aug 28 2018, 9:35 AM
davidedmundson added a subscriber: davidedmundson.

I don't see how you can be sure that the 1920_1080 resolution version of the image exists,

It seems more that we need to patch the request *in* to bing to get a correct Url back.


Please test patches first. If you need help compiling plasma, please ask.

dataengines/potd/bingprovider.cpp
71

I don't see how this would compile.

urlBase is a QVariant, you can't append to it.
You need to turn it to a string (the .toString below) here.

This revision now requires changes to proceed.Aug 28 2018, 9:35 AM