# -*- coding: iso-8859-1 -*- # Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs from re import compile, MULTILINE from ..util import tagre from ..scraper import _BasicScraper from ..helpers import regexNamer, bounceStarter, indirectStarter class ALessonIsLearned(_BasicScraper): latestUrl = 'http://www.alessonislearned.com/' stripUrl = 'http://www.alessonislearned.com/lesson%s.html' imageSearch = compile(tagre("img", "src", r"(cmx/lesson\d+\.[a-z]+)")) prevSearch = compile(tagre("a", "href", r"(index\.php\?comic=\d+)", quote="'")+r"[^>]+previous") help = 'Index format: nnn' class ASofterWorld(_BasicScraper): latestUrl = 'http://www.asofterworld.com/' stripUrl = 'http://www.asofterworld.com/index.php?id=%s' imageSearch = compile(tagre("img", "src", r'(http://www\.asofterworld\.com/clean/[^"]+)')) prevSearch = compile(tagre("a", "href", "(index\.php\?id=\d+)")+'< back') help = 'Index format: n (unpadded)' class AbleAndBaker(_BasicScraper): latestUrl = 'http://www.jimburgessdesign.com/comics/index.php' stripUrl = 'http://www.jimburgessdesign.com/comics/index.php?comic=%s' imageSearch = compile(tagre('img', 'src', r'(comics/.+)')) prevSearch = compile(tagre('a', 'href', r'(.+\d+)') + '.+?previous.gif') help = 'Index format: nnn' class AbominableCharlesChristopher(_BasicScraper): latestUrl = 'http://abominable.cc/' stripUrl = 'http://abominable.cc/%s' imageSearch = compile(tagre("img", "src", r'(http://www\.abominable\.cc/comics/[^"]+)')) prevSearch = compile(tagre("a", "href", r'([^"]+)')+"[^<]+Previous") help = 'Index format: yyyy/mm/dd/comicname' class AbsurdNotions(_BasicScraper): latestUrl = 'http://www.absurdnotions.org/page129.html' stripUrl = 'http://www.absurdnotions.org/page%s.html' imageSearch = compile(tagre('img', 'src', r'(an[^"]+)')) prevSearch = compile(tagre('a', 'href', r'([^"]+)') + tagre('img', 'src', 'nprev\.gif')) help = 'Index format: n (unpadded)' class AbstruseGoose(_BasicScraper): starter = bounceStarter('http://abstrusegoose.com/', compile(tagre('a', 'href', r'(http://abstrusegoose\.com/\d+)')+"Next »")) stripUrl = 'http://abstrusegoose.com/c%s.html' imageSearch = compile(tagre('img', 'src', r'(http://abstrusegoose\.com/strips/[^<>"]+)')) prevSearch = compile(tagre('a', 'href', r'(http://abstrusegoose\.com/\d+)') + r'« Previous') help = 'Index format: n (unpadded)' @classmethod def namer(cls, imageUrl, pageUrl): index = int(pageUrl.rstrip('/').split('/')[-1]) name = imageUrl.split('/')[-1].split('.')[0] return 'c%03d-%s' % (index, name) class AcademyVale(_BasicScraper): latestUrl = 'http://imagerie.com/vale/' stripUrl = 'http://imagerie.com/vale/avarch.cgi?%s' imageSearch = compile(tagre('img', 'src', r'(avale\d{4}-\d{2}\.gif)')) prevSearch = compile(tagre('a', 'href', r'(avarch[^"]+)') + tagre('img', 'src', 'AVNavBack\.gif')) help = 'Index format: nnn' class Alice(_BasicScraper): latestUrl = 'http://alice.alicecomics.com/' stripUrl = 'http://alice.alicecomics.com/wp-content/webcomic/alicecomics/%s.jpg' imageSearch = compile(tagre("img", "src", r'(http://alice\.alicecomics\.com/wp-content/webcomic/alicecomics/[^"]+)')) prevSearch = compile(tagre("a", "href", r'(http://alice.alicecomics.com/archive/[^"]+)', after="previous")) help = 'Index format: yyyy-mm-dd' class AlienLovesPredator(_BasicScraper): stripUrl = 'http://alienlovespredator.com/%s' imageSearch = compile(r']+>(
\n|\n|
\n)
 
', MULTILINE) prevSearch = compile(r'LATEST')) class Altermeta(_BasicScraper): latestUrl = 'http://altermeta.net/' stripUrl = 'http://altermeta.net/archive.php?comic=%s&view=showfiller' imageSearch = compile(r'') prevSearch = compile(r'Back') class Angels2200(_BasicScraper): latestUrl = 'http://www.janahoffmann.com/angels/' stripUrl = latestUrl + '%s' imageSearch = compile(tagre("img", "src", r"(http://www\.janahoffmann\.com/angels/comics/[^']+)")) prevSearch = compile(tagre("a", "href", r'([^"]+)')+"« Previous") help = 'Index format: yyyy/mm/dd/part--comic-' class AppleGeeks(_BasicScraper): latestUrl = 'http://www.applegeeks.com/' stripUrl = 'http://www.applegeeks.com/comics/viewcomic.php?issue=%s' imageSearch = compile(tagre("img", "src", r'"(strips/\d+?\..+?)"')) prevSearch = compile(r'
Previous Comic
\s*

', MULTILINE) help = 'Index format: n (unpadded)' class Achewood(_BasicScraper): latestUrl = 'http://www.achewood.com/' stripUrl = 'http://www.achewood.com/index.php?date=%s' imageSearch = compile(tagre("img", "src", r'(/comic\.php\?date=\d+)')) prevSearch = compile(tagre("a", "href", r'(index\.php\?date=\d+)', after="Previous")) help = 'Index format: mmddyyyy' namer = regexNamer(compile(r'date%3D(\d{8})')) class AstronomyPOTD(_BasicScraper): starter = bounceStarter( 'http://antwrp.gsfc.nasa.gov/apod/astropix.html', compile(r'>')) stripUrl = 'http://antwrp.gsfc.nasa.gov/apod/ap%s.html' imageSearch = compile(r'') prevSearch = compile(r'<') help = 'Index format: yymmdd' @classmethod def namer(cls, imageUrl, pageUrl): return '%s-%s' % (pageUrl.split('/')[-1].split('.')[0][2:], imageUrl.split('/')[-1].split('.')[0]) class AfterStrife(_BasicScraper): latestUrl = 'http://afterstrife.com/?p=262' stripUrl = 'http://afterstrife.com/?p=%s' imageSearch = compile(r'") help = 'Index format: yyyy/mm/strip-name' class ASkeweredParadise(_BasicScraper): latestUrl = 'http://aspcomics.net/' stripUrl = 'http://aspcomics.net/archindex.php?strip_id=%s' imageSearch = compile(tagre("img", "src", r'(http://aspcomics\.net/sites/default/files[^"]*/asp\d+\.jpg)[^"]+')) prevSearch = compile(tagre("a", "href", "(/comic/\d+)")+r"[^>]+Previous") help = 'Index format: nnn' class AGirlAndHerFed(_BasicScraper): starter = bounceStarter('http://www.agirlandherfed.com/', compile(r'[^>]+Back')) stripUrl = 'http://www.agirlandherfed.com/img/strip/%s' imageSearch = compile(tagre("img", "src", r'(img/strip/[^"]+\.jpg)')) prevSearch = compile(r'[^>]+Back') help = 'Index format: nnn' @classmethod def namer(cls, imageUrl, pageUrl): return pageUrl.split('?')[-1] class AetheriaEpics(_BasicScraper): latestUrl = 'http://aetheria-epics.schala.net/' stripUrl = 'http://aetheria-epics.schala.net/%s.html' imageSearch = compile(r'') help = 'Index format: nnn' class Adrift(_BasicScraper): latestUrl = 'http://www.adriftcomic.com/' stripUrl = 'http://www.adriftcomic.com/page%s.html' imageSearch = compile(r'') prevSearch = compile(r'« Previous') help = 'Index format: nnn' class AlienShores(_BasicScraper): latestUrl = 'http://alienshores.com/alienshores_band/' stripUrl = 'http://alienshores.com/alienshores_band/?p=%s' imageSearch = compile(r'>') help = 'Index format: nnn' class AllTheGrowingThings(_BasicScraper): latestUrl = 'http://typodmary.com/growingthings/' stripUrl = 'http://typodmary.com/growingthings/%s/' imageSearch = compile(r'') prevSearch = compile(r'« Previous') help = 'Index format: yyyy/mm/dd/strip-name' class AlsoBagels(_BasicScraper): latestUrl = 'http://www.alsobagels.com/' stripUrl = 'http://alsobagels.com/index.php/comic/%s/' imageSearch = compile(r'') help = 'Index format: strip-name' class Annyseed(_BasicScraper): latestUrl = 'http://www.colourofivy.com/annyseed_webcomic_latest.htm' stripUrl = 'http://www.colourofivy.com/annyseed_webcomic%s.htm' imageSearch = compile(r'