dosage/dosagelib/plugins/keenspot.py

80 lines
3.4 KiB
Python
Raw Normal View History

# -*- 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-06-20 19:58:13 +00:00
2012-11-21 20:57:26 +00:00
from re import compile
2012-11-26 06:13:32 +00:00
from ..scraper import make_scraper
2012-11-21 20:57:26 +00:00
from ..util import tagre
2012-06-20 19:58:13 +00:00
_imageSearch = compile(tagre("img", "src", r'([^"]*/comics/[^"]+)'))
_stripPattern = r'([^"]*/d/\d{8}\.html)'
_prevSearch = (
compile(tagre("link", "href", _stripPattern, before="prev")),
2013-04-11 16:27:43 +00:00
compile(tagre("a", "href", _stripPattern, after="prev")),
compile(tagre("a", "href", _stripPattern) + tagre("img", "id", r"previous_day1")),
2013-05-25 21:24:33 +00:00
compile(tagre("a", "href", _stripPattern) + tagre("img", "id", r"katc7")),
)
def add(name, url):
2012-12-12 16:41:29 +00:00
classname = 'KeenSpot_%s' % name
2012-12-07 23:45:18 +00:00
if '/d/' in url:
stripUrl = url.split('/d/')[0] + '/d/%s.html'
else:
stripUrl = url + 'd/%s.html'
2012-06-20 19:58:13 +00:00
2012-11-26 06:13:32 +00:00
globals()[classname] = make_scraper(classname,
name='KeenSpot/' + name,
url=url,
2012-12-07 23:45:18 +00:00
stripUrl=stripUrl,
imageSearch = _imageSearch,
prevSearch = _prevSearch,
2012-11-26 06:13:32 +00:00
help = 'Index format: yyyymmdd',
2012-11-21 20:57:26 +00:00
)
2012-06-20 19:58:13 +00:00
# do not edit anything below since these entries are generated from scripts/update.sh
# DO NOT REMOVE
add('27TwentySeven', 'http://twenty-seven.keenspot.com/')
add('Adventurers', 'http://adventurers.keenspot.com/')
add('AntiheroForHire', 'http://antihero.keenspot.com/')
add('BanzaiGirl', 'http://banzaigirl.keenspot.com/')
add('Barker', 'http://barkercomic.keenspot.com/')
add('Buzzboy', 'http://buzzboy.keenspot.com/')
add('ChoppingBlock', 'http://choppingblock.keenspot.com/')
add('ClichFlamb', 'http://clicheflambe.keenspot.com/')
add('CountYourSheep', 'http://countyoursheep.keenspot.com/')
add('EverythingJake', 'http://everythingjake.keenspot.com/')
add('FallOutToyWorks', 'http://fallouttoyworks.keenspot.com/')
add('FriarAndBrimstone', 'http://friarandbrimstone.keenspot.com/')
add('GeneCatlow', 'http://genecatlow.keenspot.com/')
add('GodMode', 'http://godmode.keenspot.com/')
add('GreenWake', 'http://greenwake.keenspot.com/')
add('HeadTrip', 'http://headtrip.keenspot.com/')
add('HoaxHunters', 'http://hoaxhunters.keenspot.com/')
add('InHere', 'http://inhere.keenspot.com/')
add('Katrina', 'http://katrina.keenspot.com/')
add('Landis', 'http://landis.keenspot.com/')
add('MakeshiftMiracle', 'http://makeshiftmiracle.keenspot.com/')
add('Marksmen', 'http://marksmen.keenspot.com/')
add('MarryMe', 'http://marryme.keenspot.com/')
add('MedusasDaughter', 'http://medusasdaughter.keenspot.com/')
add('MonsterMassacre', 'http://monstermassacre.keenspot.com/')
add('Newshounds', 'http://newshounds.keenspot.com/')
add('NoPinkPonies', 'http://nopinkponies.keenspot.com/')
add('OutThere', 'http://outthere.keenspot.com/')
add('Porcelain', 'http://porcelain.keenspot.com/')
add('QUILTBAG', 'http://quiltbag.keenspot.com/')
add('RedSpike', 'http://redspike.keenspot.com/')
add('RumbleFall', 'http://rumblefall.keenspot.com/')
add('SamuraisBlood', 'http://samuraisblood.keenspot.com/')
add('Sharky', 'http://sharky.keenspot.com/')
add('SomethingHappens', 'http://somethinghappens.keenspot.com/')
add('SoreThumbs', 'http://sorethumbs.keenspot.com/')
add('Striptease', 'http://striptease.keenspot.com/')
add('Superosity', 'http://superosity.keenspot.com/')
add('TheFirstDaughter', 'http://thefirstdaughter.keenspot.com/')
add('TheGodChild', 'http://godchild.keenspot.com/')
add('TheHuntersofSalamanstra', 'http://salamanstra.keenspot.com/')
add('TheLounge', 'http://thelounge.keenspot.com/')
add('WICKEDPOWERED', 'http://wickedpowered.keenspot.com/')