From 7e91c83753299f619c6fb106a3f5d91c5a6bc412 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Sun, 25 Nov 2012 07:56:46 +0100 Subject: [PATCH] Improved comic test. --- dosagelib/plugins/t.py | 49 ++++++++++-------------------------------- tests/test_comics.py | 6 +++--- 2 files changed, 14 insertions(+), 41 deletions(-) diff --git a/dosagelib/plugins/t.py b/dosagelib/plugins/t.py index 434a61b67..ac461ccdc 100644 --- a/dosagelib/plugins/t.py +++ b/dosagelib/plugins/t.py @@ -8,27 +8,18 @@ from ..helpers import indirectStarter from ..util import tagre -class TalesOfPylea(_BasicScraper): - latestUrl = 'http://talesofpylea.com/' - stripUrl = latestUrl + '%s/' - imageSearch = compile(r'Back') - help = 'Index format: nnn' - - - class TheNoob(_BasicScraper): latestUrl = 'http://www.thenoobcomic.com/index.php' stripUrl = latestUrl + '?pos=%' - imageSearch = compile(r'') + imageSearch = compile(tagre("img", "src", r'(/headquarters/comics/[^"]+)')) + prevSearch = compile(tagre("a", "href", r'(\?pos=\d+)', before="comic_nav_previous_button")) help = 'Index format: nnnn' class TheOrderOfTheStick(_BasicScraper): - latestUrl = 'http://www.giantitp.com/' - stripUrl = latestUrl + 'comics/images/%s' + latestUrl = 'http://www.giantitp.com/comics/oots0863.html' + stripUrl = latestUrl + 'comics/oots%s.html' imageSearch = compile(r'') prevSearch = compile(r'') prevSearch = compile(r'-\s*\n\s*\d{4}') help = 'Index format: nnn' @@ -47,37 +38,28 @@ class TheParkingLotIsFull(_BasicScraper): class TheWotch(_BasicScraper): latestUrl = 'http://www.thewotch.com/' - stripUrl = latestUrl + '?epDate=%s' + stripUrl = latestUrl + '?date=%s' imageSearch = compile(r"Prev') - help = 'Index format: nnn' - - class TinyKittenTeeth(_BasicScraper): latestUrl = 'http://www.tinykittenteeth.com/' - stripUrl = latestUrl + 'index.php?current=%s' + stripUrl = latestUrl + '%s/' imageSearch = compile(tagre("img", "src", r'(http://www\.tinykittenteeth\.com/comics/[^"]+)')) prevSearch = compile(tagre("a", "href", r'([^"]+)', after="Previous")) - help = 'Index format: n (unpadded)' + help = 'Index format: yyyy/mm/dd/stripname (unpadded)' class TwoTwoOneFour(_BasicScraper): latestUrl = 'http://www.nitrocosm.com/go/2214_classic/' stripUrl = latestUrl + '%s/' - imageSearch = compile(r']*>