Bug 153872 - Comic Strip Plasmoid does not load XKCD comic
Summary: Comic Strip Plasmoid does not load XKCD comic
Status: RESOLVED FIXED
Alias: None
Product: plasma4
Classification: Unmaintained
Component: widget-comic (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-11 22:50 UTC by Jake
Modified: 2008-12-05 06:20 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
patch as sent to Tobias (3.69 KB, patch)
2007-12-12 09:29 UTC, Markus Mauder
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jake 2007-12-11 22:50:20 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
OS:                Linux

The comic strip plasmoid does not load XKCD comic but loads the other 3. this was on kde 3.97
Comment 1 Aaron J. Seigo 2007-12-11 23:42:21 UTC
that's because xkcd doesn't have a comic available for every day, and the comic engine tries to load the comic from the current day by default. it would probably make sense to show a "no comic available today" message in that case, or even if possible just show the latest one. (note that this isn't unique to the xkcd comic support, though, it's true of all of them.)

in any case, i can confirm that the xkcd loader does indeed work as long as there is a comic available for that day.
Comment 2 Aaron J. Seigo 2007-12-12 09:09:50 UTC
On Wednesday 12 December 2007, Markus Mauder wrote:
> > in any case, i can confirm that the xkcd loader does indeed work as long
> > as there is a comic available for that day.
>
> Are you sure?


yeah, i worded that hastily. the problem is that there aren't daily strips and 
the code doesn't take that into consideration. it's a flawed assumption, 
though one that follows the other comic strip fetchers. as you note:

> Looking at the code here the data engine just tries to 
> get an id of however many days elapsed since 2006-12-06 (~ 371 days
> today?) while the number is currently at 356. As there are no daily
> updates this approach cannot really work.


yes ...

> > it would probably make sense to show a "no comic available today" message
> > in that case, or even if possible just show the latest one.
>
> I sent Tobias a patch a while back which retrieves the currently
> newest number and calculates earlier ids relative from there. This


sounds sane.

> - it doesn't really correlate the date to the strip. There is no
> information about the publishing date on the site, except in the rss
> feed. I tried using that but since it's only three strips long that
> didn't work too well either.


the xkcd one could simply work differently than the rest of them then, maybe. 
it doesn't really have to be tied accurately to a date, does it?

> - the caching may give us the same picture twice while browsing
> earlier strips when one was retrieved twice because no update happened
> for a day.


that's probably minor enough to be fine i'd think... 

> I don't know if Tobias has had a chance to look the patch over yet
> though. It doesn't seem to have been commited.


in the meantime, you could attach it to the bug report so that it doesn't get 
lost.
Comment 3 Markus Mauder 2007-12-12 09:29:34 UTC
Created attachment 22498 [details]
patch as sent to Tobias
Comment 4 Bill Egert 2007-12-12 13:32:36 UTC
I looked at this for awhile yesterday.  The ID given to an XKCD comic has nothing to do with the date, its just the Id for the comic. (so todays is 356, the next one will be 357).  Passing in Date information to the XKCDProvider then becomes useless.  There needs to be a way to query the Id from the homepage: "Permanent link to this comic: http://xkcd.com/356/" and use that Id as the starting reference point.  I tried doing this myself but I got confused :P
Comment 5 premierSullivan 2007-12-13 23:15:27 UTC
I contacted the webmaster for xkcd, and I hope we can work with them to make their comic more accessable.  xkcd is CC licensed, which means they should be very happy to help us (hopefully).  If there are any other comics with this issue I could be in contact with them too, so lets create a list.  Also, make a note of how the comics' licenses.  If they are not Creative Commons or similar, they are likely to be less than helpful unless we agree to include advertising.
Comment 6 Bill Egert 2007-12-14 01:08:03 UTC
I would just like to say I think this is an awesome endeavor!  Many props to
you.  And also to everyone who makes KDE so great, I doubt you get thanked
enough.

-Bill

On 13 Dec 2007 22:15:27 -0000, <premierSullivan@gmail.com> wrote:

[bugs.kde.org quoted mail]
I would just like to say I think this is an awesome endeavor!&nbsp; Many props to you.&nbsp; And also to everyone who makes KDE so great, I doubt you get thanked enough.<br><br>-Bill<br><br><div class="gmail_quote">On 13 Dec 2007 22:15:27 -0000,  &lt;
<a href="mailto:premierSullivan@gmail.com">premierSullivan@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">
------- You are receiving this mail because: -------<br>You are the assignee for the bug, or are watching the assignee.<br><br><a href="http://bugs.kde.org/show_bug.cgi?id=153872" target="_blank">http://bugs.kde.org/show_bug.cgi?id=153872
</a><br><br><br><br><br></div>------- Additional Comments From premierSullivan gmail com &nbsp;2007-12-13 23:15 -------<br>I contacted the webmaster for xkcd, and I hope we can work with them to make their comic more accessable. &nbsp;xkcd is CC licensed, which means they should be very happy to help us (hopefully). &nbsp;If there are any other comics with this issue I could be in contact with them too, so lets create a list. &nbsp;Also, make a note of how the comics&#39; licenses. &nbsp;If they are not Creative Commons or similar, they are likely to be less than helpful unless we agree to include advertising.
<br><div><div></div><div class="Wj3C7c">_______________________________________________<br>Panel-devel mailing list<br><a href="mailto:Panel-devel@kde.org">Panel-devel@kde.org</a><br><a href="https://mail.kde.org/mailman/listinfo/panel-devel" target="_blank">
https://mail.kde.org/mailman/listinfo/panel-devel</a><br></div></div></blockquote></div><br>
Comment 7 premierSullivan 2007-12-21 00:31:43 UTC
I haven't gotten a response from XKCD yet; should I attempt to send another message?  Also, are there any other comics that are effected (affected?) by this issue, that I can also get in touch with?
Comment 8 Jason Stubbs 2007-12-21 13:46:08 UTC
Extragear not playground
Comment 9 Alex Merry 2007-12-23 14:36:33 UTC
I'm pretty sure you're safe for xkcd: http://www.xkcd.com/license.html

The other comics may well have licensing issues.  In particular, phD comics expressly prohibits this use of their comics.
Comment 10 Alex Merry 2008-01-05 22:34:52 UTC
Suggestion: use http://xkcd.com/rss.xml or http://xkcd.com/atom.xml to get the latest comic, using the syndication reader in kdepimlibs.
Comment 11 premierSullivan 2008-01-15 21:49:44 UTC
I'm posting a reply from the webmaster of XKCD.  

Level 1 wrote:
> Dear Davean,
>
> I'm contacting you from the KDE team which is trying to create a desktop 
> widget ("plasmoid") to read daily comic strips like xkcd.  Our original code 
> attempted to retrieve daily comic strips (grabbing a comic strip associated 
> with the date).  However, since xkcd strips are not dated, there was some 
> trouble loading them.  Aaron J. Seigo said, 
> "that's because xkcd doesn't have a comic available for every day, and the 
> comic engine tries to load the comic from the current day by default. it 
> would probably make sense to show a "no comic available today" message in 
> that case, or even if possible just show the latest one. (note that this 
> isn't unique to the xkcd comic support, though, it's true of all of them.) 
>  
>  in any case, i can confirm that the xkcd loader does indeed work as long as 
> there is a comic available for that day. "
>
>   
They are dated, thats available on the archive.
> Several other webcomics have these issues.  I wrote to a kde mailing list,
> "Many of these comics providers would probably be sympathetic to us and want 
> to help us create an access media to their comics (in particular xkcd).  Is 
> it possible to create a common system to access comics and get all or many 
> these comic providers to use it?  It could be as simple as 
> http://$ComicHomePage/CurrentComic.png"
>   
There is a 'current' link, this losses a lot of information though, for 
example the alt text, a common convention in comics. I'd consider this a 
deficient solution. Anyway, including ".png" is bad form, the image 
formates vary, a link that redirects to the correct file would be 
cleaner (and was our solution in the past)

> ... to which Seigo responded,
>  "great idea. just needs someone to start contacting them. you could be that 
> person, even =)"
>
> I assume that since xkcd is Creative Commons licensed, you have no problems 
> making the comic strip accessible by desktop apps.  I hope we can talk 
> further about making comic strips like xkcd easier to access.  If you would 
> like to contact the developers directly, you should write an email to the 
> mailing list: panel-devel@kde.org , or just talk to me, and I'll talk to 
> them.
>   
Of course we want people to be able to access it easily.

What I don't get is why you don't just come to using the Atom feed. It 
contains all the relevant information, alt text, image and post date in 
a single easy download, or do you want to be able to browse 
historically? We have a solution for that also.
> Thanks for you time!
>
> Sincerely,
> Conor Sullivan
>   
-davean
Comment 12 Tobias Koenig 2008-01-15 23:24:20 UTC
On Tue, Jan 15, 2008 at 08:49:46PM -0000, premierSullivan@gmail.com wrote:
Hej,

> What I don't get is why you don't just come to using the Atom feed. It 
> contains all the relevant information, alt text, image and post date in 
> a single easy download, or do you want to be able to browse 
> historically? We have a solution for that also.

That sounds good, can you give me his email address so I can ask for
details?

Ciao,
Tobias
Comment 13 Marco Martin 2008-02-08 12:40:16 UTC
SVN commit 772315 by mart:

This patch adds two items to the dataengine: "Next identifier suffix" and "Previous identifier suffix"
that says where to search the previous and next comics (if any) so now it's not tied to a date and to the concept of having one update a day.
and this fixes the xkcd comic (bug 153872)  that uses integer identifiers instead of dates for the comic
so now the logic to where search the next/previous is delegated to the comicprovider, and if there is no suffix the dataengine simply loads the today's comic.
the cache still works, but is disabled for today's comic, because it can become stale if it was actually an old comic and a new one is published today, and of course today it won't have a "Next identifier suffix" but tomorrow will.

BUG: 153872

 M  +18 -13    applets/comic/comic.cpp  
 M  +3 -1      applets/comic/comic.h  
 M  +14 -3     dataengines/comic/cachedprovider.cpp  
 M  +13 -1     dataengines/comic/cachedprovider.h  
 M  +75 -21    dataengines/comic/comic.cpp  
 M  +8 -1      dataengines/comic/comic.h  
 M  +9 -0      dataengines/comic/comicprovider.cpp  
 M  +23 -1     dataengines/comic/comicprovider.h  
 M  +19 -0     dataengines/comic/dilbertprovider.cpp  
 M  +4 -0      dataengines/comic/dilbertprovider.h  
 M  +20 -1     dataengines/comic/garfieldprovider.cpp  
 M  +4 -0      dataengines/comic/garfieldprovider.h  
 M  +24 -11    dataengines/comic/osnewsprovider.cpp  
 M  +4 -0      dataengines/comic/osnewsprovider.h  
 M  +19 -0     dataengines/comic/snoopyprovider.cpp  
 M  +4 -0      dataengines/comic/snoopyprovider.h  
 M  +19 -0     dataengines/comic/userfriendlyprovider.cpp  
 M  +4 -0      dataengines/comic/userfriendlyprovider.h  
 M  +51 -23    dataengines/comic/xkcdprovider.cpp  
 M  +5 -1      dataengines/comic/xkcdprovider.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=772315
Comment 14 David Dempster 2008-12-05 06:20:00 UTC
It would be good to make sure that the title attribute of the image, which is displayed as a tooltip in browsers, is displayed in the widget.  With Xkcd, it contains an extra punchline, and delivers half the humour of the thing.

(For some reason, the webmaster refers to the title attribute as the "alt text", harking back to the days of IE6.)