Quote:
Originally Posted by mhuntoon
would adding
def preprocess_html(self, soup):
return self.adeify_images(soup)
help with the gocomics recipe you shared? it's very difficult to read the strips on my kindle 2. Otherwise, it works great.
if adding that will help, where do I put it?
|
Try it and let me know. (or I'll do it for you if you send me your Kindle2!)
Change the return line as follows:
Code:
def preprocess_html(self, soup):
if soup.title:
title_string = soup.title.string.strip()
_cd = title_string.split(',',1)[1]
comic_date = ' '.join(_cd.split(' ', 4)[0:-1])
if soup.h1.span:
artist = soup.h1.span.string
soup.h1.span.string.replaceWith(comic_date + artist)
feature_item = soup.find('p',attrs={'class':'feature_item'})
if feature_item.a:
a_tag = feature_item.a
a_href = a_tag["href"]
img_tag = a_tag.img
img_tag["src"] = a_href
img_tag["width"] = self.comic_size
img_tag["height"] = None
return self.adeify_images(soup)