# -*- coding: iso-8859-1 -*- # Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs # Copyright (C) 2012-2013 Bastian Kleineidam from re import compile from ..util import tagre from ..scraper import _BasicScraper from ..helpers import indirectStarter class BadMachinery(_BasicScraper): url = 'http://scarygoround.com/' stripUrl = url + '?date=%s' imageSearch = compile(tagre("img", "src", r'(strips/\d+[^"]+)')) prevSearch = compile(tagre("a", "href", r'(\?date=\d+)') + 'Previous') help = 'Index format: yyyymmdd' class Bardsworth(_BasicScraper): url = 'http://www.bardsworth.com/' stripUrl = url + '?p=%s' imageSearch = compile(tagre("img", "src", r'(http://www\.bardsworth\.com/comics/[^"]+)')) prevSearch = compile(tagre("a", "href", r'(http://www\.bardsworth\.com/[^"]+)', after="prev")) help = 'Index format: nnn' class BetterDays(_BasicScraper): url = 'http://jaynaylor.com/betterdays/' stripUrl = url + 'archives/%s.html' imageSearch = compile(tagre("img", "src", r'(/betterdays/comic/[^>]+)', quote="")) prevSearch = compile(tagre("a", "href", r'([^"]+)') + '« Previous') help = 'Index format: yyyy/mm/' class BiggerThanCheeses(_BasicScraper): url = 'http://www.biggercheese.com/' stripUrl = url + 'index.php?comic=%s' imageSearch = compile(r'src="(comics/.+?)" alt') prevSearch = compile(r'"(index.php\?comic=.+?)".+?_back') help = 'Index format: n (unpadded)' class BizarreUprising(_BasicScraper): url = 'http://www.bizarreuprising.com/' stripUrl = url + 'view/%s' imageSearch = compile(tagre("img", "src", r'(comic/[^"]+)')) prevSearch = compile(tagre("a", "href", r'(view/\d+/[^"]+)') + tagre("img", "src", r'images/b_prev\.gif')) help = 'Index format: n/name' class Blip(_BasicScraper): url = 'http://blipcomic.com/' stripUrl = url + 'index.php?strip_id=%s' imageSearch = compile(r'(istrip_files/strips/.+?)"') prevSearch = compile(r'First.+?"(index.php\?strip_id=.+?)".+?prev') help = 'Index format: n' @classmethod def prevUrlModifier(cls, prevUrl): if prevUrl: return prevUrl.replace("www.blipcomic.com", "blipcomic.com") class BlueCrashKit(_BasicScraper): url = 'http://robhamm.com/bluecrashkit/' stripUrl = url + 'comics/blue-crash-kit/%s' imageSearch = compile(tagre("img", "src", r'(http://robhamm\.com/bluecrashkit/sites/default/files/comics/[^"]+)')) prevSearch = compile(r'