# -*- coding: iso-8859-1 -*- # Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs from re import compile from ..scraper import _BasicScraper from ..helpers import constStarter, bounceStarter, indirectStarter from ..util import tagre, getQueryParams class CalvinAndHobbes(_BasicScraper): starter = bounceStarter('http://www.gocomics.com/calvinandhobbes/', compile(tagre("a", "href", "(/calvinandhobbes/\d+/\d+/\d+)")+"Next feature")) imageUrl = 'http://www.gocomics.com/calvinandhobbes/%s' imageSearch = compile(tagre("img", "src", "(http://assets\.amuniversal\.com/[a-f0-9]+)")) prevSearch = compile(tagre("a", "href", "(/calvinandhobbes/\d+/\d+/\d+)")+"Previous feature") help = 'Index format: yyyy/mm/dd' @classmethod def namer(cls, imageUrl, pageUrl): prefix, year, month, day = pageUrl.rsplit('/', 3) return "%s%s%s.gif" % (year, month, day) class CandyCartoon(_BasicScraper): latestUrl = 'http://www.candycartoon.com/' imageUrl = 'http://www.candycartoon.com/archives/%s.html' imageSearch = compile(r'[^prev') help = 'Index format: nnnnnn' class CaptainSNES(_BasicScraper): latestUrl = 'http://captainsnes.com/' imageUrl = 'http://captainsnes.com/?date=%s' imageSearch = compile(r'') help = 'Index format: yyyymmdd' class CaribbeanBlue(_BasicScraper): latestUrl = 'http://cblue.katbox.net/' imageUrl = 'http://cblue.katbox.net/index.php?strip_id=%s' imageSearch = compile(r'="(.+?strips/.+?)"') prevSearch = compile(r'.+?"(.+?)".+?Previous') help = 'Index format: n (unpadded)' class Catharsis(_BasicScraper): latestUrl = 'http://catharsiscomic.com/' imageUrl = 'http://catharsiscomic.com/archive.php?strip=%s' imageSearch = compile(r'') help = 'Index format: yyyy/mm/dd/strip-name' class ChugworthAcademy(_BasicScraper): latestUrl = 'http://chugworth.com/' imageUrl = 'http://chugworth.com/?p=%s' imageSearch = compile(r'Comic')
    prevSearch = compile(r'<a href=]+?title="Previous">') help = 'Index format: n (unpadded)' class ChugworthAcademyArchive(_BasicScraper): latestUrl = 'http://chugworth.com/archive/?strip_id=422' imageUrl = 'http://chugworth.com/archive/?strip_id=%s' imageSearch = compile(r'&laq') help = 'Index format: non' class CombustibleOrange(_BasicScraper): latestUrl = 'http://www.combustibleorange.com/' imageUrl = 'http://www.combustibleorange.com/index.php?current=%s' imageSearch = compile(r'') help = 'Index format: n (unpadded)' class Comedity(_BasicScraper): latestUrl = 'http://www.comedity.com/' imageUrl = 'http://www.comedity.com/index.php?strip_id=%s' imageSearch = compile(r' *\"Prior') help = 'Index format: n' class CoolCatStudio(_BasicScraper): latestUrl = 'http://www.coolcatstudio.com/' imageUrl = 'http://www.coolcatstudio.com/index.php?p=%s' imageSearch = compile(r'(/comics/.+?)"') prevSearch = compile(r"href='(.+?)'>PREV") help = 'Index format: n' class CourtingDisaster(_BasicScraper): latestUrl = 'http://www.courting-disaster.com/' imageUrl = 'http://www.courting-disaster.com/archive/%s.html' imageSearch = compile(r'(/comics/.+?)"') prevSearch = compile(r']+?>') help = 'Index format: yyyymmdd' class CrapIDrewOnMyLunchBreak(_BasicScraper): latestUrl = 'http://crap.jinwicked.com/' imageUrl = 'http://crap.jinwicked.com/%s' imageSearch = compile(r'<< Previous page') help = 'Index format: yyyymmdd' def cloneManga(name, shortName, lastStrip=None): baseUrl = 'http://manga.clone-army.org/%s.php' % (shortName,) imageUrl = baseUrl + '?page=%s' if lastStrip is None: starter = bounceStarter(baseUrl, compile(r'") help = 'Index format: n (unpadded)' def comicsDotCom(name, section): latestUrl = 'http://www.gocomics.com/%s' % name @classmethod def namer(cls, imageUrl, pageUrl): prefix, year, month, day = pageUrl.split('/', 3) return "%s_%s%s%s.gif" % (name, year, month, day) return type('GoComicsDotCom_%s' % name, (_BasicScraper,), dict( name='GoComicsDotCom/' + name, imageUrl=latestUrl + '/%s', imageSearch=compile(tagre("img", "src", r'(http://assets\.amuniversal\.com/[0-9a-f]+)')), prevSearch=compile(tagre("a", "href", "(/%s/\d+/\d+/\d+)")+"Previous"), help='Index format: yyyy/mm/dd', namer=namer) ) # http://www.gocomics.com/features # XXX # http://www.gocomics.com/explore/editorial_list # XXX # http://www.gocomics.com/explore/sherpa_list # XXX acaseinpoint = comicsDotCom('acaseinpoint', 'comics') agnes = comicsDotCom('agnes', 'creators') alleyoop = comicsDotCom('alleyoop', 'comics') andycapp = comicsDotCom('andycapp', 'creators') arlonjanis = comicsDotCom('arlonjanis', 'comics') ballardst = comicsDotCom('ballardst', 'creators') barkeaterlake = comicsDotCom('barkeaterlake', 'comics') bc = comicsDotCom('bc', 'creators') ben = comicsDotCom('ben', 'comics') betty = comicsDotCom('betty', 'comics') bignate = comicsDotCom('bignate', 'comics') bonanas = comicsDotCom('bonanas', 'wash') bornloser = comicsDotCom('bornloser', 'comics') buckets = comicsDotCom('buckets', 'comics') candorville = comicsDotCom('candorville', 'wash') cheapthrills = comicsDotCom('cheapthrills', 'wash') chickweed = comicsDotCom('chickweed', 'comics') committed = comicsDotCom('committed', 'comics') dilbert = comicsDotCom('dilbert', 'comics') drabble = comicsDotCom('drabble', 'comics') fatcats = comicsDotCom('fatcats', 'comics') ferdnand = comicsDotCom('ferdnand', 'comics') flightdeck = comicsDotCom('flightdeck', 'creators') floandfriends = comicsDotCom('floandfriends', 'creators') franknernest = comicsDotCom('franknernest', 'comics') frazz = comicsDotCom('frazz', 'comics') geech = comicsDotCom('geech', 'comics') genepool = comicsDotCom('genepool', 'wash') getfuzzy = comicsDotCom('getfuzzy', 'comics') gofish = comicsDotCom('gofish', 'comics') graffiti = comicsDotCom('graffiti', 'comics') grandave = comicsDotCom('grandave', 'comics') grizzwells = comicsDotCom('grizzwells', 'comics') heathcliff = comicsDotCom('heathcliff', 'creators') hedge = comicsDotCom('hedge', 'comics') herbnjamaal = comicsDotCom('herbnjamaal', 'creators') herman = comicsDotCom('herman', 'comics') humblestumble = comicsDotCom('humblestumble', 'comics') janesworld = comicsDotCom('janesworld', 'comics') jumpstart = comicsDotCom('jumpstart', 'comics') kitncarlyle = comicsDotCom('kitncarlyle', 'comics') liberty = comicsDotCom('liberty', 'creators') lilabner = comicsDotCom('lilabner', 'comics') luann = comicsDotCom('luann', 'comics') marmaduke = comicsDotCom('marmaduke', 'comics') meg = comicsDotCom('meg', 'comics') moderatelyconfused = comicsDotCom('moderatelyconfused', 'comics') momma = comicsDotCom('momma', 'creators') monty = comicsDotCom('monty', 'comics') motley = comicsDotCom('motley', 'comics') nancy = comicsDotCom('nancy', 'comics') naturalselection = comicsDotCom('naturalselection', 'creators') offthemark = comicsDotCom('offthemark', 'comics') onebighappy = comicsDotCom('onebighappy', 'creators') othercoast = comicsDotCom('othercoast', 'creators') pcnpixel = comicsDotCom('pcnpixel', 'wash') peanuts = comicsDotCom('peanuts', 'comics') pearls = comicsDotCom('pearls', 'comics') pibgorn = comicsDotCom('pibgorn', 'comics') pickles = comicsDotCom('pickles', 'wash') raisingduncan = comicsDotCom('raisingduncan', 'comics') reality = comicsDotCom('reality', 'comics') redandrover = comicsDotCom('redandrover', 'wash') ripleys = comicsDotCom('ripleys', 'comics') roseisrose = comicsDotCom('roseisrose', 'comics') rubes = comicsDotCom('rubes', 'creators') rudypark = comicsDotCom('rudypark', 'comics') shirleynson = comicsDotCom('shirleynson', 'comics') soup2nutz = comicsDotCom('soup2nutz', 'comics') speedbump = comicsDotCom('speedbump', 'creators') spotthefrog = comicsDotCom('spotthefrog', 'comics') strangebrew = comicsDotCom('strangebrew', 'creators') sunshineclub = comicsDotCom('sunshineclub', 'comics') tarzan = comicsDotCom('tarzan', 'comics') thatslife = comicsDotCom('thatslife', 'wash') wizardofid = comicsDotCom('wizardofid', 'creators') workingdaze = comicsDotCom('workingdaze', 'comics') workingitout = comicsDotCom('workingitout', 'creators') def creators(name, shortname): return type('Creators_%s' % name, (_BasicScraper,), dict( name='Creators/' + name, latestUrl='http://www.creators.com/comics_show.cfm?ComicName=%s' % (shortname,), imageUrl=None, imageSearch=compile(r'[^'), prevSearch=compile(r'< Previous') help = 'Index format: n (unpadded)' class CrimsonDark(_BasicScraper): latestUrl = 'http://www.davidcsimon.com/crimsondark/' imageUrl = 'http://www.davidcsimon.com/crimsondark/index.php?view=comic&strip_id=%s' imageSearch = compile(r'src="(.+?strips/.+?)"') prevSearch = compile(r'') help = 'Index format: nnn' class CowboyJedi(_BasicScraper): latestUrl = 'http://www.cowboyjedi.com/' imageUrl = 'http://www.cowboyjedi.com/%s' imageSearch = compile(r'') help = 'Index format: nnn' class Collar6(_BasicScraper): latestUrl = 'http://collar6.com/' imageUrl = 'http://collar6.com/%s' imageSearch = compile(r'src="(http://collar6.com/comics/.+?)"') prevSearch = compile(r' href="(http://collar6.com/\d+/\S+)">◄ Previous') help = 'Index format: yyyy/namednumber' class Chester5000XYV(_BasicScraper): latestUrl = 'http://jessfink.com/Chester5000XYV/' imageUrl = 'http://jessfink.com/Chester5000XYV/?p=%s' imageSearch = compile(r'') help = 'Index format: nnn' class CalamitiesOfNature(_BasicScraper): latestUrl = 'http://www.calamitiesofnature.com/' imageUrl = 'http://www.calamitiesofnature.com/archive/?c=%s' imageSearch = compile(r'') help = 'Index format: nnn' class Champ2010(_BasicScraper): latestUrl = 'http://www.jedcollins.com/champ2010/' imageUrl = 'http://jedcollins.com/champ2010/?p=%s' imageSearch = compile(r'Next>')) imageUrl = 'http://corydoncafe.com/comic-%s.html' imageSearch = compile(r'<Previous') help = 'Index format: nnn' @classmethod def namer(cls, imageUrl, pageUrl): return pageUrl.split('/')[-1].split('.')[0] class CraftedFables(_BasicScraper): latestUrl = 'http://www.craftedfables.com/' imageUrl = 'http://www.caf-fiends.net/craftedfables/?p=%s' imageSearch = compile(r'') help = 'Index format: nnn' class Currhue(_BasicScraper): latestUrl = 'http://www.currhue.com/' imageUrl = 'http://www.currhue.com/?p=%s' imageSearch = compile(r'