dosage/dosagelib/plugins/pensandtales.py

30 lines
1 KiB
Python
Raw Normal View History

2012-12-08 20:30:51 +00:00
# -*- coding: iso-8859-1 -*-
# Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs
2014-01-05 15:50:57 +00:00
# Copyright (C) 2012-2014 Bastian Kleineidam
2012-12-08 20:30:51 +00:00
from re import compile
from ..scraper import make_scraper
from ..util import tagre
2013-11-18 21:01:30 +00:00
_imageSearch = compile(tagre("img", "src", r'([^"]*wp-content/uploads/[^"]+)'))
2012-12-08 20:30:51 +00:00
def add(name, baseUrl, param="date"):
classname = 'PensAndTales_%s' % name
2013-11-18 21:01:30 +00:00
_prevSearch = compile(tagre("span", "class", "mininav-prev") +
tagre("a", "href", r'([^"]*\?%s=[-\d]+)' % param))
2012-12-08 20:30:51 +00:00
globals()[classname] = make_scraper(classname,
name='PensAndTales/' + name,
url = baseUrl,
2012-12-08 20:30:51 +00:00
stripUrl = baseUrl + '?' + param + '=%s',
imageSearch = _imageSearch,
prevSearch = _prevSearch,
help='Index format: yyyymmdd'
)
2013-11-18 21:01:30 +00:00
# Most of the comics linked at pensandtales are broken and
2012-12-08 20:30:51 +00:00
# the rest does not have a common layout. It seems they allow
# almost arbitrary HTML layout.
2013-11-18 21:01:30 +00:00
add('FireflyCross', 'http://www.fireflycross.pensandtales.com/', param="comic")
2012-12-08 20:30:51 +00:00
add('Evilish', 'http://evilish.pensandtales.com/')