dosage/dosagelib/plugins/o.py

75 lines
3.1 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 indirectStarter
2012-11-21 20:57:26 +00:00
from ..util import tagre
2012-06-20 19:58:13 +00:00
class OctopusPie(_BasicScraper):
2012-11-21 20:57:26 +00:00
starter = indirectStarter('http://www.octopuspie.com/',
compile(tagre("a", "href", r'(http://www\.octopuspie\.com/[^"]+)') +
tagre("img", "src", r'http://www\.octopuspie\.com/junk/latest\.png')))
2012-11-13 18:10:19 +00:00
stripUrl = 'http://www.octopuspie.com/%s'
2012-11-21 20:57:26 +00:00
imageSearch = compile(tagre("img", "src", r'(http://www\.octopuspie\.com/strippy/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(http://www\.octopuspie\.com/[^"]+)', after="prev"))
2012-06-20 19:58:13 +00:00
help = 'Index format: yyyy-mm-dd/nnn-strip-name'
class OddFish(_BasicScraper):
latestUrl = 'http://www.odd-fish.net/'
2012-11-21 20:57:26 +00:00
stripUrl = latestUrl + '%s/'
imageSearch = compile(tagre("img", "src", r'(http://www\.odd-fish\.net/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(http://www\.odd-fish\.net/[^"]+)', after="navi-prev"))
help = 'Index format: stripname'
2012-06-20 19:58:13 +00:00
class OnTheEdge(_BasicScraper):
2012-11-21 20:57:26 +00:00
latestUrl = 'http://ontheedgecomics.com/'
2012-11-13 18:10:19 +00:00
stripUrl = 'http://ontheedgecomics.com/comic/ote%s'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'<img src="(http://ontheedgecomics.com/comics/.+?)"')
prevSearch = compile(r'<a href="([^"]+)" rel="prev">')
help = 'Index format: nnn (unpadded)'
class OneQuestion(_BasicScraper):
latestUrl = 'http://onequestioncomic.com/'
2012-11-21 20:57:26 +00:00
stripUrl = latestUrl + 'comic.php?strip_id=%s'
imageSearch = compile(tagre("img", "src", r'(istrip_files/strips/\d+\.jpg)'))
prevSearch = compile(tagre("a", "href", r'(comic\.php\?strip_id=\d+)') + tagre("img", "src", r'img/arrow_prev\.jpg'))
2012-06-20 19:58:13 +00:00
help = 'Index format: n (unpadded)'
class OurHomePlanet(_BasicScraper):
latestUrl = 'http://gdk.gd-kun.net/'
stripUrl = latestUrl + '%s.html'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'<img src="(pages/comic.+?)"')
prevSearch = compile(r'coords="50,18,95,65".+?href="(.+?\.html)".+?alt=')
help = 'Index format: n (unpadded)'
class OkCancel(_BasicScraper):
2012-11-21 20:57:26 +00:00
stripUrl = 'http://okcancel.com/comic/%s.html'
imageSearch = compile(tagre("img", "src", r'(http://okcancel\.com/strips/okcancel\d{8}\.gif)'))
prevSearch = compile(tagre("div", "class", "previous") + tagre("a", "href", r'(http://okcancel\.com/comic/\d{1,4}\.html)'))
starter = indirectStarter('http://okcancel.com/', prevSearch)
2012-06-20 19:58:13 +00:00
help = 'Index format: yyyymmdd'
class Oglaf(_BasicScraper):
2012-11-21 20:57:26 +00:00
latestUrl = 'http://oglaf.com/'
stripUrl = latestUrl + '%s/'
imageSearch = compile(tagre("img", "src", r'(/media/comic/[^"]+)', before="strip"))
prevSearch = compile(tagre("a", "href", r'([^"]+)') + tagre("div", "id", "pvs"))
help = 'Index format: stripname/nn'
2012-06-20 19:58:13 +00:00
class OverCompensating(_BasicScraper):
latestUrl = 'http://www.overcompensating.com/'
stripUrl = latestUrl + 'posts/%s.html'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'<img src="(/comics/.+?)"')
prevSearch = compile(r'"><a href="(.+?)"[^>]+?>&nbsp;\<\- &nbsp;</a>')
help = 'Index format: yyyymmdd'