From 6c773e21c70dc38bdb9cc9a6d6ba774a21ac07be Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Thu, 25 Apr 2013 21:06:12 +0200 Subject: [PATCH] Added Lackadaisy. --- doc/changelog.txt | 3 ++- dosagelib/plugins/l.py | 22 +++++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/doc/changelog.txt b/doc/changelog.txt index 8639e1423..49d469b1f 100644 --- a/doc/changelog.txt +++ b/doc/changelog.txt @@ -1,7 +1,8 @@ Dosage 2.2 (released xx.xx.2013) Features: -- comic: Added ARedTailsDream, Carciphona, Curtailed, GirlGenius. +- comic: Added ARedTailsDream, Carciphona, Curtailed, GirlGenius, + Lackadaisy. Patch by Dirk Reiners Changes: diff --git a/dosagelib/plugins/l.py b/dosagelib/plugins/l.py index ee9a68d64..1090869d6 100644 --- a/dosagelib/plugins/l.py +++ b/dosagelib/plugins/l.py @@ -4,10 +4,30 @@ from re import compile, escape from ..scraper import _BasicScraper -from ..helpers import indirectStarter +from ..helpers import bounceStarter, indirectStarter from ..util import tagre +class Lackadaisy(_BasicScraper): + description = u'Alcohol-running cats in prohibition St. Louis' + baseUrl = 'http://lackadaisy.foxprints.com/' + url = baseUrl + 'comic.php' + stripUrl = baseUrl + 'comic.php?comicid=%s' + firstStripUrl = stripUrl % '1' + imageSearch = compile(tagre("img", "src", r'(http://www\.lackadaisycats\.com/comic/[^"]*)')) + prevSearch = compile(tagre("a", "href", r"(/comic\.php\?comicid=[0-9]+)") + "< Previous") + help = 'Index format: n' + starter = bounceStarter(url, + compile(tagre("a", "href", r"(/comic.php\?comicid=[0-9]+)") + "Next")) + + @classmethod + def namer(cls, imageUrl, pageUrl): + """Use comic id for filename.""" + num = pageUrl.rsplit('=', 1)[-1] + ext = imageUrl.rsplit('.', 1)[-1] + return 'lackadaisy_%s.%s' % (num, ext) + + class LasLindas(_BasicScraper): url = 'http://laslindas.katbox.net/' rurl = escape(url)