dosage/dosagelib/plugins/r.py

62 lines
2.5 KiB
Python
Raw Normal View History

# -*- coding: iso-8859-1 -*-
# Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs
2012-11-21 20:57:26 +00:00
# Copyright (C) 2012 Bastian Kleineidam
2012-06-20 19:58:13 +00:00
2012-11-21 20:57:26 +00:00
from re import compile
2012-10-11 10:03:12 +00:00
from ..scraper import _BasicScraper
from ..helpers import bounceStarter
2012-11-21 20:57:26 +00:00
from ..util import tagre
2012-06-20 19:58:13 +00:00
class RadioactivePanda(_BasicScraper):
latestUrl = 'http://www.radioactivepanda.com/'
stripUrl = latestUrl + 'comic/%s'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'<img src="(/Assets/.*?)".+?"comicimg"')
prevSearch = compile(r'<a href="(/comic/.*?)".+?previous_btn')
help = 'Index format: n (no padding)'
2012-11-21 20:57:26 +00:00
# XXX add other comics at http://petitesymphony.com/comics/
2012-06-20 19:58:13 +00:00
class Rascals(_BasicScraper):
2012-11-21 20:57:26 +00:00
latestUrl = 'http://rascals.petitesymphony.com/'
stripUrl = latestUrl + '/comic/rascals-pg-%s/'
imageSearch = compile(tagre("img", "src", r'(http://rascals\.petitesymphony\.com/files/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(http://rascals\.petitesymphony\.com/comic/[^"]+)', after="Previous"))
help = 'Index format: num'
2012-06-20 19:58:13 +00:00
class RealLife(_BasicScraper):
latestUrl = 'http://www.reallifecomics.com/'
2012-11-21 20:57:26 +00:00
stripUrl = latestUrl + 'archive/%s.html'
imageSearch = compile(tagre("img", "src", r'(/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(/archive/\d+.html)') + tagre("img", "src", r'/images/nav_prev\.png'))
2012-06-20 19:58:13 +00:00
help = 'Index format: yymmdd)'
class RedString(_BasicScraper):
latestUrl = 'http://www.redstring.strawberrycomics.com/'
2012-11-21 20:57:26 +00:00
stripUrl = latestUrl + 'index.php?id=%s'
imageSearch = compile(tagre("img", "src", r'("comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(/index\.php\?id=\d+)', after="prev"))
2012-06-20 19:58:13 +00:00
help = 'Index format: nnn'
class Roza(_BasicScraper):
latestUrl = 'http://www.junglestudio.com/roza/index.php'
stripUrl = latestUrl + '?date=%s'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'<img src="(pages/.+?)"')
prevSearch = compile(r'<a href="(index.php\?date=.+?)">[^>].+?navtable_01.gif')
help = 'Index format: yyyy-mm-dd'
class RedMeat(_BasicScraper):
starter = bounceStarter('http://www.redmeat.com/redmeat/current/index.html', compile(r'<a href="(\.\./\d{4}-\d{2}-\d{2}/index\.html)">next</a>'))
2012-11-13 18:10:19 +00:00
stripUrl = 'http://www.redmeat.com/redmeat/%s/index.html'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'<img src="(index-1\.gif)" width="\d+" height="\d+" [^>]*>')
prevSearch = compile(r'<a href="(\.\./\d{4}-\d{2}-\d{2}/index\.html)">previous</a>')
help = 'Index format: yyyy-mm-dd'
@classmethod
def namer(cls, imageUrl, pageUrl):
return imageUrl.split('/')[-2]