# -*- coding: iso-8859-1 -*- # Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs # Copyright (C) 2012 Bastian Kleineidam from re import compile from ..scraper import _BasicScraper from ..helpers import indirectStarter from ..util import tagre, getQueryParams class DMFA(_BasicScraper): latestUrl = 'http://www.missmab.com/' stripUrl = latestUrl + 'Comics/Vol_%s.php' imageSearch = compile(tagre("img", "src", r'(Comics/|Vol)[^"]+)')) prevSearch = compile(tagre("a", "href", r'([^"])+')+ tagre("img", "src", r'(?:../)?Images/comicprev.gif')) help = 'Index format: nnn (normally, some specials)' class DandyAndCompany(_BasicScraper): latestUrl = 'http://www.dandyandcompany.com/' stripUrl = latestUrl + '%s' imageSearch = compile(tagre("img", "src", r'([^"]*/strips/[^"]+)')) prevSearch = compile(r'<.+?/aprev.gif"') help = 'Index format: nnn' class DeepFried(_BasicScraper): latestUrl = 'http://www.whatisdeepfried.com/' stripUrl = latestUrl + '%s' imageSearch = compile(tagre("img", "src", r'(http://www\.whatisdeepfried\.com/comics/[^"]+)')) prevSearch = compile(tagre("a", "href", r'(http://www\.whatisdeepfried\.com/[^"]+)', after="prev")) help = 'Index format: non' class DoemainOfOurOwn(_BasicScraper): latestUrl = 'http://www.doemain.com/' stripUrl = latestUrl + 'index.cgi/%s' imageSearch = compile(r"Previous Strip') prevSearch = compile(r'Previous Week,') help = 'Index format: nnnnn' class Dracula(_BasicScraper): latestUrl = 'http://draculacomic.net/' stripUrl = latestUrl + 'comic.php?comicID=%s' imageSearch = compile(tagre("img", "src", r'(comics/[^"]+)')) prevSearch = compile(r' « Prev') help = 'Index format: nnn' class DragonTails(_BasicScraper): latestUrl = 'http://www.dragon-tails.com/' stripUrl = latestUrl + 'archive.php?date=%s' imageSearch = compile(r'"(newcomic/.+?)"') prevSearch = compile(r'"(archive.+?)">.+n_2') help = 'Index format: yyyy-mm-dd' class DreamKeepersPrelude(_BasicScraper): latestUrl = 'http://www.dreamkeeperscomic.com/Prelude.php' stripUrl = latestUrl + '?pg=%s' imageSearch = compile(r'(images/PreludeNew/.+?)"') prevSearch = compile(r'(Prelude.php\?pg=.+?)"') help = 'Index format: n' class Drowtales(_BasicScraper): latestUrl = 'http://www.drowtales.com/mainarchive.php' stripUrl = latestUrl + '?sid=%s' imageSearch = compile(tagre("img", "src", r'("http://www.drowtales.com/mainarchive/[^"]+)')) prevSearch = compile(tagre("a", "href", r'(\?sid=\d+)', before="link_prev_top")) help = 'Index format: number' class DieselSweeties(_BasicScraper): latestUrl = 'http://www.dieselsweeties.com/' stripUrl = latestUrl + 'archive/%s' imageSearch = compile(tagre("img", "src", r'(/hstrips/[^"]+)')) prevSearch = compile(tagre("a", "href", r'(/archive/\d+)') + tagre("img", "src", r'http://www\.dieselsweeties\.com/ximages/blackbackarrow160.png')) help = 'Index format: n (unpadded)' @classmethod def namer(cls, imageUrl, pageUrl): index = int(imageUrl.split('/')[-1].split('.')[0]) return 'sw%02d' % (index,) class DominicDeegan(_BasicScraper): latestUrl = 'http://www.dominic-deegan.com/' stripUrl = latestUrl + 'view.php?date=%s' imageSearch = compile(r'') starter = indirectStarter('http://dresdencodak.com/', compile(r'
')) # XXX dilbert.com