From ceb19ed2bc732c871c24f808c0517156556d9743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damjan=20Ko=C5=A1ir?= Date: Mon, 1 Jun 2015 12:14:52 +1200 Subject: [PATCH] fixed Wulffmorgenthaler (now Wumo), added TruthFacts and MeAndDanielle --- dosagelib/plugins/kindofnormal.py | 19 +++++++++++++++++++ dosagelib/plugins/w.py | 11 ----------- 2 files changed, 19 insertions(+), 11 deletions(-) create mode 100644 dosagelib/plugins/kindofnormal.py diff --git a/dosagelib/plugins/kindofnormal.py b/dosagelib/plugins/kindofnormal.py new file mode 100644 index 000000000..6a6be0473 --- /dev/null +++ b/dosagelib/plugins/kindofnormal.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from dosagelib.helpers import indirectStarter +from ..scraper import make_scraper, _ParserScraper + + +def add(name, url): + attrs = dict( + name=name, + url='http://kindofnormal.com/' + url, + imageSearch='//article[1]//div[@class="box-content"]//img', + prevSearch='//a[@class="prev"]' + ) + globals()[name] = make_scraper(name, _ParserScraper, **attrs) + + +add('MeAndDanielle', 'meanddanielle') +add('TruthFacts', 'truthfacts') +add('Wumo', 'wumo') +add('Wulffmorgenthaler', 'wumo') # name in previous versions diff --git a/dosagelib/plugins/w.py b/dosagelib/plugins/w.py index 125815840..b39771764 100644 --- a/dosagelib/plugins/w.py +++ b/dosagelib/plugins/w.py @@ -239,14 +239,3 @@ class _WorldOfWarcraftEh(_BasicScraper): stripUrl = None imageSearch = compile(r'http://woweh.com/(comics/.+?)"') prevSearch = compile(r'woweh.com/(\?p=.+:?)".+:?="prev') - - -class Wulffmorgenthaler(_BasicScraper): - url = 'http://kindofnormal.com/wumo/' - rurl = escape(url) - stripUrl = url + '%s' - imageSearch = compile(tagre("div", "class", r'box-content') + r"\s*" + - tagre("a", "href", r'[^"]+') + r"\s*" + - tagre("img", "src", r'(http://kindofnormal\.com/img/wumo/\d+/\d+/[^/"]+)')) - prevSearch = compile(tagre("a", "href", r'(%s[^"]+)' % rurl) + tagre("i", "class", r'icon-chevron-left')) - help = 'Index format: yyyy/mm/dd'