xkcd

Plasma Comic Sources

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

5
Score 53.6%
Description:

xkcd (http://xkcd.com/) plugin for plasma comic.
Last changelog:

1.1 3 months ago

Thank you Hans-Peter for the changes.

9

z3ntu

2 years ago

Broken, please fix :)

Report

TuxmAL

2 years ago

Hi, I've noted a change in xkcd.com site, gone full https now. Here are the fixes needed to patch the code:
33c33
< var re = new RegExp("Permanent link to this comic: http://xkcd.com/(\\d+)/");
---
> var re = new RegExp("Permanent link to this comic: https://xkcd.com/(\\d+)/");
47c47
< comic.requestPage("http:" + match[1], comic.Image);
---
> comic.requestPage("https:" + match[1], comic.Image);

a couple of fix again makes ' and " in additionalText looks like quote and double quote:
56c56,57
< comic.additionalText = match[2];
---
> var additionalTxt = match[2];
> comic.additionalText = additionalTxt.replace(/quot;/g, "\"").replace(/'/g, "'");
thanks!

Report

TuxmAL

2 years ago

ops! last patch is
56c56,57
< comic.additionalText = match[2];
---
> var additionalTxt = match[2];
> comic.additionalText = additionalTxt.replace(/quot;/g, "\"").replace(/&'/g, "'");

Report

TuxmAL

2 years ago

ugh! Last replace contains / & # 3 9 ;/ (remove spaces between chars).

Report

C

mfuchs

2 years ago

Thanks for your work! I updated the comic.

Report

TuxmAL

2 years ago

You are welcome!
Thanks for your work, it has been a good source to learn comics plugin!

Report

cbxAmadyne

4 years ago

The original code does not handle empty "title" and "alt" tags to well. This patch fixes that as well:http://download.amadyne.net/xkcd-main-2015-04.patch

Quote:
--- main.es 2009-02-01 03:40:16.000000000 +0100
+++ main_new.es 2015-04-02 08:26:04.215609602 +0200
@@ -41,10 +41,10 @@
}
}
if (id == comic.Page) {
- var re = new RegExp("<img src=\"(http://imgs.xkcd.com/comics/[^\"]+)\"");
+ var re = new RegExp("<img src=\"(//imgs\.xkcd\.com/comics/[^\"]+)\"");
var match = re.exec(data);
if (match != null) {
- comic.requestPage(match[1], comic.Image);
+ comic.requestPage("http:" + match[1], comic.Image);
} else {
comic.error();
return;
@@ -49,12 +49,15 @@
comic.error();
return;
}
-
//find the tooltip and the strip title of the comic
- re = new RegExp("src=\"http://imgs.xkcd.com/comics/.+\" title=\"([^\"]+)\" alt=\"([^\"]+)\"");
+ re = new RegExp("<img src=\"(//imgs\.xkcd\.com/comics/[^\"]+)\" title=\"([^\"]+)\"");
+ match = re.exec(data);
+ if (match != null) {
+ comic.additionalText = match[2];
+ }
+ re = new RegExp("<img src=\"(//imgs\.xkcd\.com/comics/[^\"]+)\".+alt=\"([^\"]+)\"");
match = re.exec(data);
if (match != null) {
- comic.additionalText = match[1];
comic.title = match[2];
}
}

Report

C

mfuchs

4 years ago

Thanks for the patch. :) I updated xkcd using your changes.

Report

cbxAmadyne

4 years ago

xkcd.com has updated the image link to no longer contain "http:"

Quote:
--- main_new.es 2015-04-01 17:35:10.992105603 +0200
+++ main.es 2009-02-01 03:40:16.000000000 +0100
@@ -41,10 +41,10 @@
}
}
if (id == comic.Page) {
- var re = new RegExp("<img src=\"(//imgs.xkcd.com/comics/[^\"]+)\"");
+ var re = new RegExp("<img src=\"(http://imgs.xkcd.com/comics/[^\"]+)\"");
var match = re.exec(data);
if (match != null) {
- comic.requestPage("http:" + match[1], comic.Image);
+ comic.requestPage(match[1], comic.Image);
} else {
comic.error();
return;

Report

9

quazgar

5 years ago

Please have a look at KDE bug #333063 https://bugs.kde.org/show_bug.cgi?id=333063

For some comics this great plugin crashes the Plasma Desktop.

Report

1.1 3 months ago

Thank you Hans-Peter for the changes.

12345678910
43
product-maker weearc May 27 2017 9 excellent
product-maker z3ntu Dec 21 2016 9 excellent
product-maker quazgar Sep 04 2014 9 excellent
product-maker bewatched Nov 11 2010 3 bad
product-maker XxtjaxX Oct 11 2010 3 bad
product-maker gildor Oct 10 2010 3 bad
product-maker adz21c Sep 23 2010 3 bad
product-maker Base: 4 x 5.0 Ratings
Be the first to comment
SLUnatic85
May 30 2018
Mte90
Jul 28 2011
wmotti
Jun 28 2010
drdanz
Feb 12 2010
TheUserK
Jan 04 2010
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
version
1.1
updated Sep 14 2019
added Oct 24 2008
downloads 24h
57
mediaviews 24h 0
pageviews 24h 10