# -*- coding: iso-8859-1 -*- # Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs from re import compile, IGNORECASE from ..scraper import _BasicScraper from ..helpers import bounceStarter, indirectStarter from ..util import getQueryParams, tagre class UglyHill(_BasicScraper): latestUrl = 'http://www.uglyhill.com/' stripUrl = latestUrl + 'd/%s.html' imageSearch = compile(tagre("img", "src", r'(/comic[s|/][^"]+)')) prevSearch = compile(tagre("a", "href", r'[^"]*(/d/\d+\.s?html)')+r"[^>]+/images/(?:nav_02|previous_day)\.gif") help = 'Index format: yyyymmdd' class UnderPower(_BasicScraper): latestUrl = 'http://underpower.non-essential.com/' stripUrl = latestUrl + 'index.php?comic=%s' imageSearch = compile(r'(?:)?()?')) stripUrl = 'http://ars.userfriendly.org/cartoons/?id=%s&mode=classic' imageSearch = compile(r'Previous Cartoon') help = 'Index format: yyyymmdd' @classmethod def namer(cls, imageUrl, pageUrl): return 'uf%s' % (getQueryParams(pageUrl)['id'][0][2:],) class UndeadFriend(_BasicScraper): latestUrl = 'http://www.undeadfriend.com/' stripUrl = latestUrl + 'd/%s.html' imageSearch = compile(r'src="(http://www\.undeadfriend\.com/comics/.+?)"', IGNORECASE) prevSearch = compile(r'