From 4006ced43da03859374fa539a4a936010eabec88 Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Mon, 2 May 2016 01:25:34 +0200 Subject: [PATCH] Move all HijinksEnsue comics into alphabetic files. --- dosagelib/plugins/a.py | 5 ++--- dosagelib/plugins/b.py | 7 +++---- dosagelib/plugins/common.py | 4 ++++ dosagelib/plugins/f.py | 7 +++++++ dosagelib/plugins/h.py | 30 ++++++++++++++++++++++++++++-- dosagelib/plugins/l.py | 9 ++++++++- dosagelib/plugins/wordpress.py | 25 ------------------------- 7 files changed, 52 insertions(+), 35 deletions(-) delete mode 100644 dosagelib/plugins/wordpress.py diff --git a/dosagelib/plugins/a.py b/dosagelib/plugins/a.py index 0bd6e36b8..903275038 100644 --- a/dosagelib/plugins/a.py +++ b/dosagelib/plugins/a.py @@ -10,7 +10,7 @@ from re import compile, escape, MULTILINE from ..util import tagre from ..scraper import _BasicScraper, _ParserScraper from ..helpers import regexNamer, bounceStarter, indirectStarter -from .common import _WordPressScraper, xpath_class, WP_LATEST_SEARCH +from .common import _WordPressScraper, _WPNaviIn, xpath_class, WP_LATEST_SEARCH class AbstruseGoose(_BasicScraper): @@ -117,9 +117,8 @@ class ALessonIsLearned(_BasicScraper): help = 'Index format: nnn' -class Alice(_WordPressScraper): +class Alice(_WPNaviIn): url = 'http://www.alicecomics.com/' - prevSearch = '//a[%s]' % xpath_class('navi-prev-in') latestSearch = '//a[text()="Latest Alice!"]' starter = indirectStarter diff --git a/dosagelib/plugins/b.py b/dosagelib/plugins/b.py index 4feaa4f9a..073802b73 100644 --- a/dosagelib/plugins/b.py +++ b/dosagelib/plugins/b.py @@ -10,8 +10,8 @@ from re import compile, escape from ..util import tagre from ..scraper import _BasicScraper, _ParserScraper from ..helpers import indirectStarter -from .common import (_ComicControlScraper, _WordPressScraper, WP_PREV_SEARCH, - xpath_class) +from .common import (_ComicControlScraper, _WordPressScraper, _WPNaviIn, + WP_PREV_SEARCH, xpath_class) class BadassMuthas(_BasicScraper): @@ -221,9 +221,8 @@ class Buni(_WordPressScraper): url = 'http://www.bunicomic.com/' -class BusinessCat(_WordPressScraper): +class BusinessCat(_WPNaviIn): url = 'http://www.businesscat.happyjar.com/' - prevSearch = '//a[%s]' % xpath_class('navi-prev-in') class ButtercupFestival(_ParserScraper): diff --git a/dosagelib/plugins/common.py b/dosagelib/plugins/common.py index e3f1ceb63..a2491c5d4 100644 --- a/dosagelib/plugins/common.py +++ b/dosagelib/plugins/common.py @@ -28,6 +28,10 @@ class _WordPressScraper(_ParserScraper): prevSearch = WP_PREV_SEARCH +class _WPNaviIn(_WordPressScraper): + prevSearch = '//a[%s]' % xpath_class('navi-prev-in') + + class _ComicControlScraper(_ParserScraper): imageSearch = '//img[@id="cc-comic"]' prevSearch = '//a[@rel="prev"]' diff --git a/dosagelib/plugins/f.py b/dosagelib/plugins/f.py index b39677d4d..57a67518d 100644 --- a/dosagelib/plugins/f.py +++ b/dosagelib/plugins/f.py @@ -9,6 +9,7 @@ from re import compile, escape, IGNORECASE from ..util import tagre from ..scraper import _BasicScraper, _ParserScraper from ..helpers import indirectStarter +from .common import _WPNaviIn class FalconTwin(_BasicScraper): @@ -20,6 +21,12 @@ class FalconTwin(_BasicScraper): help = 'Index format: nnn' +class Faneurysm(_WPNaviIn): + url = 'http://hijinksensue.com/comic/think-only-tree/' + firstStripUrl = 'http://hijinksensue.com/comic/captains-prerogative/' + endOfLife = True + + class FantasyRealms(_BasicScraper): url = 'http://www.fantasyrealmsonline.com/' stripUrl = url + 'manga/%s.php' diff --git a/dosagelib/plugins/h.py b/dosagelib/plugins/h.py index 73c231ae9..efe9543a2 100644 --- a/dosagelib/plugins/h.py +++ b/dosagelib/plugins/h.py @@ -6,10 +6,11 @@ from __future__ import absolute_import, division, print_function from re import compile, escape + from ..scraper import _BasicScraper from ..util import tagre -from ..helpers import bounceStarter -from .common import _WordPressScraper +from ..helpers import bounceStarter, indirectStarter +from .common import _WordPressScraper, _WPNaviIn class HagarTheHorrible(_BasicScraper): @@ -60,3 +61,28 @@ class HarkAVagrant(_BasicScraper): class Hipsters(_WordPressScraper): url = 'http://www.hipsters-comic.com/' firstStripUrl = 'http://www.hipsters-comic.com/comic/hip01/' + + +class HijinksEnsue(_WPNaviIn): + url = 'http://hijinksensue.com/' + latestSearch = '//a[text()="Latest HijiNKS ENSUE"]' + firstStripUrl = 'http://hijinksensue.com/comic/who-is-your-daddy-and-what-does-he-do/' + starter = indirectStarter + + +class HijinksEnsueClassic(_WPNaviIn): + url = 'http://hijinksensue.com/comic/open-your-eyes/' + firstStripUrl = 'http://hijinksensue.com/comic/a-soul-as-black-as-eyeliner/' + endOfLife = True + + +class HijinksEnsueConvention(_WPNaviIn): + url = 'http://hijinksensue.com/comic/emerald-city-comicon-2015-fancy-sketches-part-4/' + firstStripUrl = 'http://hijinksensue.com/comic/whatever-dad-im-outta-here/' + endOfLife = True + + +class HijinksEnsuePhoto(_WPNaviIn): + url = 'http://hijinksensue.com/comic/emerald-city-comicon-2015-fancy-photo-comic-part-2/' + firstStripUrl = 'http://hijinksensue.com/comic/san-diego-comic-con-fancy-picto-comic-pt-1/' + endOfLife = True diff --git a/dosagelib/plugins/l.py b/dosagelib/plugins/l.py index 2c6ebab62..8ae09d077 100644 --- a/dosagelib/plugins/l.py +++ b/dosagelib/plugins/l.py @@ -10,7 +10,8 @@ from re import compile, escape from ..scraper import _BasicScraper, _ParserScraper from ..helpers import bounceStarter, indirectStarter from ..util import tagre -from .common import _ComicControlScraper, _WordPressScraper, WP_LATEST_SEARCH +from .common import (_ComicControlScraper, _WordPressScraper, _WPNaviIn, + WP_LATEST_SEARCH) class Lackadaisy(_BasicScraper): @@ -89,6 +90,12 @@ class LoadingArtist(_ParserScraper): prevSearch = "//a[contains(concat(' ', @class, ' '), ' prev ')]" +class LoFiJinks(_WPNaviIn): + url = 'http://hijinksensue.com/comic/learning-to-love-again/' + firstStripUrl = 'http://hijinksensue.com/comic/lo-fijinks-everything-i-know-anout-james-camerons-avatar-movie/' + endOfLife = True + + class LookingForGroup(_ParserScraper): url = 'http://www.lfgcomic.com/' stripUrl = url + 'page/%s/' diff --git a/dosagelib/plugins/wordpress.py b/dosagelib/plugins/wordpress.py deleted file mode 100644 index 8aac5d360..000000000 --- a/dosagelib/plugins/wordpress.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -from ..helpers import indirectStarter -from ..scraper import make_scraper -from .common import _WordPressScraper - - -def add(name, start): - attrs = dict( - name=name, - url='http://hijinksensue.com/', - latestSearch=start, - starter=indirectStarter - ) - globals()[name] = make_scraper(name, _WordPressScraper, **attrs) - - -# all comics on HijiNKS ENSUE -for (name, starterXPath) in [ - ('HijinksEnsue', '//h4[text()="Read The Latest HijiNKS ENSUE"]/..//a'), - ('HijinksEnsueClassic', '//h4[text()="Read HijiNKS ENSUE Classic"]/..//a[3]'), - ('Faneurysm', '//h4[text()="Read The Latest FANEURYSM"]/..//a'), - ('HijinksEnsueConvention', '//h4[text()="Latest Fancy Convention Sketches"]/..//a'), - ('HijinksEnsuePhoto', '//h4[text()="Latest Fancy Photo Comic"]/..//a') -]: - add(name, starterXPath)