Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 5fb5ce7f authored by Tagore Chandan Reddy's avatar Tagore Chandan Reddy Committed by Nate Graham

[KdePlasma-Addons/POTD/NOAA] Fixed RegEx string of landing page

Summary: 'Image of the day' has a new landing page everyday. This patch fixes the RegEx string that fetches the web address of the landing page.

Test Plan: All plugins should work as usual.

Reviewers: davidedmundson, ngraham

Reviewed By: davidedmundson, ngraham

Subscribers: ngraham, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D18232
parent ff26a139
......@@ -58,11 +58,11 @@ void NOAAProvider::firstPageRequestFinished(KJob* _job)
// to use heavy weight QtWebkit. So we use QRegularExpression to capture
// the wanted url here.
QString url;
QRegularExpression re(QStringLiteral("href=\"(.*)\"><img alt=\"Latest Image of the Day"), QRegularExpression::MultilineOption);
QRegularExpression re(QStringLiteral("href=\".*\\/content\\/(.*)\"><img alt=\"Latest Image of the Day"), QRegularExpression::MultilineOption);
auto result = re.match(data);
if (result.hasMatch())
{
url = result.captured(1);
url = QStringLiteral("http://www.nesdis.noaa.gov/content/") + result.captured(1);
}
if (url.isEmpty())
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment