2016-04-14 21:52:35 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
2012-11-21 20:57:26 +00:00
|
|
|
# Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs
|
2014-01-05 15:50:57 +00:00
|
|
|
# Copyright (C) 2012-2014 Bastian Kleineidam
|
2016-04-14 21:52:35 +00:00
|
|
|
# Copyright (C) 2015-2016 Tobias Gruetzmacher
|
2012-11-21 20:57:26 +00:00
|
|
|
|
2016-04-14 21:52:35 +00:00
|
|
|
from __future__ import absolute_import, division, print_function
|
|
|
|
|
|
|
|
from ..scraper import _ParserScraper
|
|
|
|
from ..helpers import indirectStarter
|
|
|
|
|
|
|
|
|
2016-06-05 20:11:22 +00:00
|
|
|
class Snafu(_ParserScraper):
|
2016-04-14 21:52:35 +00:00
|
|
|
# Next and Previous are swapped...
|
|
|
|
prevSearch = '//a[@class="next"]'
|
|
|
|
imageSearch = '//div[@class="comicpage"]/img'
|
|
|
|
latestSearch = '//div[@id="feed"]/a'
|
|
|
|
starter = indirectStarter
|
|
|
|
|
2016-06-05 20:11:22 +00:00
|
|
|
def __init__(self, name, path):
|
|
|
|
super(Snafu, self).__init__('SnafuComics/' + name)
|
|
|
|
self.url = 'http://snafu-comics.com/swmseries/' + path
|
2016-04-14 21:52:35 +00:00
|
|
|
|
2016-04-21 06:20:49 +00:00
|
|
|
def namer(self, image_url, page_url):
|
2016-04-14 21:52:35 +00:00
|
|
|
year, month, name = image_url.rsplit('/', 3)[1:]
|
|
|
|
return "%04s_%02s_%s" % (year, month, name)
|
|
|
|
|
2016-06-05 20:11:22 +00:00
|
|
|
@classmethod
|
|
|
|
def getmodules(cls):
|
|
|
|
return [
|
|
|
|
cls('Braindead', 'braindead'),
|
|
|
|
cls('Bunnywith', 'bunnywith'),
|
|
|
|
cls('DeliverUsEvil', 'deliverusevil'),
|
|
|
|
cls('EA', 'ea'),
|
|
|
|
cls('FT', 'ft'),
|
|
|
|
cls('GrimTalesFromDownBelow', 'grimtales'),
|
|
|
|
cls('KOF', 'kof'),
|
|
|
|
cls('MyPanda', 'mypanda'),
|
|
|
|
cls('NarutoHeroesPath', 'naruto'),
|
|
|
|
cls('NewSuperMarioAdventures', 'nsma'),
|
|
|
|
cls('PowerPuffGirls', 'powerpuffgirls'),
|
|
|
|
# cls('PSG2', 'psg2'), -- Strangely broken
|
|
|
|
cls('SatansExcrement', 'satansexcrement'),
|
|
|
|
cls('SF', 'sf'),
|
|
|
|
cls('SkullBoy', 'skullboy'),
|
|
|
|
cls('Snafu', 'snafu'),
|
|
|
|
cls('Soul', 'soul'),
|
|
|
|
cls('Sugar', 'sugarbits'),
|
|
|
|
cls('SureToBeBanD', 'stbb'),
|
|
|
|
cls('TheLeague', 'league'),
|
|
|
|
cls('Tin', 'tin'),
|
|
|
|
cls('Titan', 'titan'),
|
|
|
|
cls('TrunksAndSoto', 'trunks-and-soto'),
|
|
|
|
cls('TW', 'tw'),
|
|
|
|
cls('Zim', 'zim'),
|
|
|
|
]
|