# -*- 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 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")) stripUrl = '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/' stripUrl = 'http://www.candycartoon.com/archives/%s.html' imageSearch = compile(r'[^prev') help = 'Index format: nnnnnn' class CaptainSNES(_BasicScraper): latestUrl = 'http://captainsnes.com/' stripUrl = 'http://captainsnes.com/?date=%s' imageSearch = compile(r'') help = 'Index format: yyyymmdd' class CaribbeanBlue(_BasicScraper): latestUrl = 'http://cblue.katbox.net/' stripUrl = 'http://cblue.katbox.net/index.php?strip_id=%s' imageSearch = compile(r'="(.+?strips/.+?)"') prevSearch = compile(r'') help = 'Index format: yyyy/mm/dd/strip-name' class ChugworthAcademy(_BasicScraper): latestUrl = 'http://chugworth.com/' stripUrl = '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' stripUrl = 'http://chugworth.com/archive/?strip_id=%s' imageSearch = compile(r'&laq') help = 'Index format: non' class CombustibleOrange(_BasicScraper): latestUrl = 'http://www.combustibleorange.com/' stripUrl = 'http://www.combustibleorange.com/index.php?current=%s' imageSearch = compile(r'') help = 'Index format: n (unpadded)' class Comedity(_BasicScraper): latestUrl = 'http://www.comedity.com/' stripUrl = '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/' stripUrl = 'http://www.coolcatstudio.com/index.php?p=%s' imageSearch = compile(tagre("img", "src", r'(http://www.coolcatstudio.com/comics/[^"]+)')) prevSearch = compile(tagre("a", "href", r'(http://www\.coolcatstudio\.com/strips-cat/[^"]+)', before="cniprevt")) help = 'Index format: n' class CourtingDisaster(_BasicScraper): latestUrl = 'http://www.courting-disaster.com/' stripUrl = '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/' stripUrl = 'http://crap.jinwicked.com/%s' imageSearch = compile(r'<< Previous page') help = 'Index format: yyyymmdd' def cloneManga(name, shortName, lastStrip=None): url = 'http://manga.clone-army.org' baseUrl = '%s/%s.php' % (url, shortName) stripUrl = baseUrl + '?page=%s' if lastStrip is None: starter = bounceStarter(baseUrl, compile(tagre("a", "href", r'([^"]+)')+tagre("img", "src", r"next\.gif"))) else: starter = constStarter(stripUrl % lastStrip) def namer(self, imageUrl, pageUrl): return '%03d' % int(getQueryParams(pageUrl)['page'][0]) return type('CloneManga_%s' % name, (_BasicScraper,), dict( name='CloneManga/' + name, starter=starter, stripUrl=stripUrl, imageSearch=compile(tagre("img", "src", r'((?:%s/)?%s/[^"]+)' % (url, shortName), after="center")), prevSearch=compile(tagre("a", "href", r'([^"]+)')+tagre("img", "src", r"previous\.gif")), help='Index format: n', namer=namer) ) anm = cloneManga('AprilAndMay', 'anm') kanami = cloneManga('Kanami', 'kanami') momoka = cloneManga('MomokaCorner', 'momoka') nana = cloneManga('NanasEverydayLife', 'nana', '78') pxi = cloneManga('PaperEleven', 'pxi', '311') t42r = cloneManga('Tomoyo42sRoom', 't42r') penny = cloneManga('PennyTribute', 'penny') class CatAndGirl(_BasicScraper): latestUrl = 'http://catandgirl.com/' stripUrl = 'http://catandgirl.com/?p=%s' imageSearch = compile(tagre("img", "src", r'(http://catandgirl\.com/archive/[^"]+)')) prevSearch = compile(tagre("a", "href", r'([^"]+)')+r"[^<]+Previous") 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, stripUrl=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,), stripUrl=None, imageSearch=compile(r'[^'), prevSearch=compile(r'< Previous') help = 'Index format: n (unpadded)' class CrimsonDark(_BasicScraper): latestUrl = 'http://www.davidcsimon.com/crimsondark/' stripUrl = '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/' stripUrl = 'http://www.cowboyjedi.com/%s' imageSearch = compile(r'') help = 'Index format: nnn' class Collar6(_BasicScraper): latestUrl = 'http://collar6.com/' stripUrl = 'http://collar6.com/wp-content/webcomic/collar6/%s.jpg' imageSearch = compile(tagre("img", "src", r'(http://collar6\.com/wp-content/webcomic/collar6/[^"]+)')) prevSearch = compile(tagre("a", "href", r'(http://collar6\.com/archive/[^"]+)', after="previous")) help = 'Index format: yyyy-mm-dd-Collar-n-nnn' class Chester5000XYV(_BasicScraper): latestUrl = 'http://jessfink.com/Chester5000XYV/' stripUrl = 'http://jessfink.com/Chester5000XYV/?p=%s' imageSearch = compile(r'') help = 'Index format: nnn' class CalamitiesOfNature(_BasicScraper): latestUrl = 'http://www.calamitiesofnature.com/' stripUrl = 'http://www.calamitiesofnature.com/archive/?c=%s' imageSearch = compile(r'') help = 'Index format: nnn' class Champ2010(_BasicScraper): latestUrl = 'http://www.jedcollins.com/champ2010/' stripUrl = 'http://jedcollins.com/champ2010/?p=%s' imageSearch = compile(r'Next>')) stripUrl = '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/' stripUrl = 'http://www.caf-fiends.net/craftedfables/?p=%s' imageSearch = compile(r'') help = 'Index format: nnn' class Currhue(_BasicScraper): latestUrl = 'http://www.currhue.com/' stripUrl = 'http://www.currhue.com/?p=%s' imageSearch = compile(r'