Dilbert: Fix for new websitre format

This commit is contained in:
Dirk Reiners 2015-01-16 12:05:53 -06:00
parent 3724eba835
commit e25270c866

View file

@ -183,20 +183,18 @@ class DieselSweeties(_BasicScraper):
class Dilbert(_BasicScraper): class Dilbert(_BasicScraper):
url = 'http://dilbert.com/' url = 'http://dilbert.com/'
stripUrl = url + '%s/' stripUrl = url + '/strip/%s/'
firstStripUrl = stripUrl % '1989-04-16' firstStripUrl = stripUrl % '1989-04-16'
starter = bounceStarter(url, starter = indirectStarter(url, compile(tagre("a", "href", r'(http://dilbert.com/strip/[0-9-]*)', after="Click to see")))
compile(tagre("a", "href", r'(/\d+-\d+-\d+/)', after="STR_Next"))) prevSearch = compile(tagre("a", "href", r'(/strip/\d+-\d+-\d+)', after="Older Strip"))
prevSearch = compile(tagre("a", "href", r'(/\d+-\d+-\d+/)', after="STR_Prev")) imageSearch = compile(tagre("img", "src", r'(http://assets.amuniversal.com/\w+)'))
imageSearch = compile(tagre("img", "src", r'(/dyn/str_strip/[^"]+\.strip\.zoom\.gif)'))
help = 'Index format: yyyy-mm-dd' help = 'Index format: yyyy-mm-dd'
description = u'A comic featuring satirical office humor about a white-collar, micromanaged office featuring the engineer Dilbert as the title character.' description = u'A comic featuring satirical office humor about a white-collar, micromanaged office featuring the engineer Dilbert as the title character.'
@classmethod @classmethod
def namer(cls, imageUrl, pageUrl): def namer(cls, imageUrl, pageUrl):
ext = imageUrl.rsplit(".", 1)[1] name = pageUrl.rsplit("/", 1)[1]
name = pageUrl.rsplit("/", 2)[1] return "%s" % name
return "%s.%s" % (name, ext)
class DMFA(_BasicScraper): class DMFA(_BasicScraper):