From c63f927e5c85c77b94db021eefdfb0a538c08b35 Mon Sep 17 00:00:00 2001 From: mbrandis Date: Fri, 14 Nov 2014 20:09:42 +0100 Subject: [PATCH] - Modified OnTheFasttrack adapting the new API. --- dosagelib/plugins/o.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) mode change 100755 => 100644 dosagelib/plugins/o.py diff --git a/dosagelib/plugins/o.py b/dosagelib/plugins/o.py old mode 100755 new mode 100644 index 6a702744b..3c5d7f3bb --- a/dosagelib/plugins/o.py +++ b/dosagelib/plugins/o.py @@ -92,14 +92,23 @@ class OnTheEdge(_BasicScraper): class OnTheFasttrack(_BasicScraper): - url = 'http://www.onthefastrack.com/' - rurl = escape(url) - stripUrl = url + '?webcomic1=%s' - firstStripUrl = stripUrl % '2010-08-09' - imageSearch = compile(tagre("img", "src", r'(%swp-content/uploads/\d+/\d+/[^"]+-\d+-\d+\.[^"]+)' % rurl)) - prevSearch = compile(tagre("a", "href", r'(%s\?webcomic1=[^"]+)' % rurl, after="prev")) + url = 'http://onthefastrack.com/' + stripUrl = url + 'comics/%s' + firstStripUrl = stripUrl % 'november-13-2000' + imageSearch = compile(tagre("img", "src", r'(http://safr\.kingfeatures\.com/idn/test/zone/xml/content\.php\?file=.+?)')) + prevSearch = compile(r'<Previous| rel="prev)') description = u'On The Fasttrack by Bill Holbrook' - help = 'Index format: yyyy-mm-dd' + help = 'Index format: monthname-dd-yyyy' + + @classmethod + def namer(cls, imageUrl, pageUrl): + name = pageUrl.rsplit('/', 3)[2] + if name == "onthefastrack.com": + import datetime + name = datetime.date.today().strftime("%B-%d-%Y") + # name.title ensures that the comics are named the same + # as in the previous scraper + return "%s.gif" % name.title() class OneQuestion(_BasicScraper):