toothpaste for dinner
s2r2
Source (link to git-repo or to original if based on someone elses unmodified work):
v0.1: basically a sed-replace-job from mfuchs's wonderful snoopy-plugin [1].
[1] http://kde-files.org/content/show.php/Snoopy+%28en%29?content=92041
Ratings & Comments
7 Comments
I fixed the file main.es to make it work... Follows the patch hopefully it will show correctly... --- main.es 2009-03-17 06:24:39.000000000 -0500 +++ main.es 2009-12-08 12:37:27.895469170 -0600 @@ -49,7 +49,7 @@ } } if ( id == comic.Page ) { - const expImage = new RegExp( "<img src=\"(http://assets.comics.com/dyn/str_strip/(\\d+/)+\\d+\\.full[^\"]+)\"" ); + const expImage = new RegExp( "<img src=\"(http://([^\/]+)/dyn/str_strip/[^\.]+\.full[^\"]+)\"" ); const matchImage = expImage.exec( data ); if ( matchImage != null ) { comic.requestPage( matchImage[1], comic.Image ); @@ -57,7 +57,14 @@ comic.error(); } - const expPrev = new RegExp( "Link_Previous: '/pearls_before_swine/(\\d{4}-\\d{2}-\\d{2})/'" ); + //title + re = new RegExp("class=\"STR_StripImage\" title=\"([^\"]+)\""); + match = re.exec(data); + if (match != null) { + comic.title = match[1]; + } + + const expPrev = new RegExp( "Link_Previous: '/pearls_before_swine/(\\d{4}-\\d{2}-\\d{2})/'" ); const matchPrev = expPrev.exec( data ); if ( matchPrev != null ) { comic.previousIdentifier = date.fromString( matchPrev[1], date.ISODate );
Since the title has already the name of the comic from the .desktop file I changed it to put the title of the strip and the date on the "alternate text" popup with this patch: --- main.es 2009-03-17 06:24:39.000000000 -0500 +++ main.es 2009-12-08 13:11:16.000000000 -0600 @@ -49,7 +49,7 @@ } } if ( id == comic.Page ) { - const expImage = new RegExp( "<img src=\"(http://assets.comics.com/dyn/str_strip/(\\d+/)+\\d+\\.full[^\"]+)\"" ); + const expImage = new RegExp( "<img src=\"(http://([^\/]+)/dyn/str_strip/[^\.]+\.full[^\"]+)\"" ); const matchImage = expImage.exec( data ); if ( matchImage != null ) { comic.requestPage( matchImage[1], comic.Image ); @@ -57,7 +57,15 @@ comic.error(); } - const expPrev = new RegExp( "Link_Previous: '/pearls_before_swine/(\\d{4}-\\d{2}-\\d{2})/'" ); + //Alternate Text + re = new RegExp("class=\"STR_StripImage\" title=\"([^\"]+)\""); + match = re.exec(data); + if (match != null) { + comic.additionalText = match[1]; + print(comic.additionalText); + } + + const expPrev = new RegExp( "Link_Previous: '/pearls_before_swine/(\\d{4}-\\d{2}-\\d{2})/'" ); const matchPrev = expPrev.exec( data ); if ( matchPrev != null ) { comic.previousIdentifier = date.fromString( matchPrev[1], date.ISODate );
Sorry, I left the print command on the previous one... --- main.es 2009-03-17 06:24:39.000000000 -0500 +++ main.es 2009-12-08 13:20:29.000000000 -0600 @@ -49,7 +49,7 @@ } } if ( id == comic.Page ) { - const expImage = new RegExp( "<img src=\"(http://assets.comics.com/dyn/str_strip/(\\d+/)+\\d+\\.full[^\"]+)\"" ); + const expImage = new RegExp( "<img src=\"(http://([^\/]+)/dyn/str_strip/[^\.]+\.full[^\"]+)\"" ); const matchImage = expImage.exec( data ); if ( matchImage != null ) { comic.requestPage( matchImage[1], comic.Image ); @@ -57,7 +57,14 @@ comic.error(); } - const expPrev = new RegExp( "Link_Previous: '/pearls_before_swine/(\\d{4}-\\d{2}-\\d{2})/'" ); + //Alternate Text + re = new RegExp("class=\"STR_StripImage\" title=\"([^\"]+)\""); + match = re.exec(data); + if (match != null) { + comic.additionalText = match[1]; + } + + const expPrev = new RegExp( "Link_Previous: '/pearls_before_swine/(\\d{4}-\\d{2}-\\d{2})/'" ); const matchPrev = expPrev.exec( data ); if ( matchPrev != null ) { comic.previousIdentifier = date.fromString( matchPrev[1], date.ISODate );
It seems to be broken (again?); it's stuck on the one from awhile ago with Larry in the zoo (the second in that series, kid says "hey, it's dad with a snout"). Hitting back does go to the previous strip (the first in the plotline), but back again and it loops around to the second one. Hitting "jump to first strip" jumps to the true first strip, but "jump to current strip" just goes back to Larry-in-the-Zoo Strip 2. It's been stuck like this, at least for me, since that strip was in fact new.
For me it doesn't work either. I removed the plasma applet, deleted all files associated with it, but when installing it again, it simply does not show any Pearls comic at all :-(
Something must have changed at comics.com -- hope to fix it soon.
(Without any changes to the script) it started working again. (Weird.)