mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Good House Keeping by Anonymous
This commit is contained in:
parent
5d2a278c4f
commit
517e75316b
31
recipes/good_house_keeping.recipe
Normal file
31
recipes/good_house_keeping.recipe
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
|
class AdvancedUserRecipe1305547242(BasicNewsRecipe):
|
||||||
|
title = u'Good House Keeping'
|
||||||
|
language = 'en'
|
||||||
|
__author__ = 'Anonymous'
|
||||||
|
oldest_article = 7
|
||||||
|
max_articles_per_feed = 100
|
||||||
|
no_stylesheets = True
|
||||||
|
use_embedded_content = False
|
||||||
|
remove_javascript = True
|
||||||
|
|
||||||
|
def print_version(self,url):
|
||||||
|
segments = url.split('/')
|
||||||
|
printURL = '/'.join(segments[0:3]) + '/print-this/' + '/'.join(segments[4:])
|
||||||
|
return printURL
|
||||||
|
|
||||||
|
def preprocess_html(self, soup):
|
||||||
|
for alink in soup.findAll('a'):
|
||||||
|
if alink.string is not None:
|
||||||
|
tstr = alink.string
|
||||||
|
alink.replaceWith(tstr)
|
||||||
|
return soup
|
||||||
|
|
||||||
|
feeds = [ (u'Recipes & Entertaining', u'http://www.goodhousekeeping.com/food/food-rss/?src=rss'),
|
||||||
|
(u'Home & House', u'http://www.goodhousekeeping.com/home/home-rss/?src=rss'),
|
||||||
|
(u'Diet & Health', u'http://www.goodhousekeeping.com/health/health-rss/?src=rss'),
|
||||||
|
(u'Beauty & Style', u'http://www.goodhousekeeping.com/beauty/beauty-rss/?src=rss'),
|
||||||
|
(u'Family & Pets', u'http://www.goodhousekeeping.com/family/family-rss/?src=rss'),
|
||||||
|
(u'Saving Money', u'http://www.goodhousekeeping.com/money/money-rss/?src=rss'),
|
||||||
|
]
|
@ -693,10 +693,12 @@ class MobiReader(object):
|
|||||||
try:
|
try:
|
||||||
lm = float(lm)
|
lm = float(lm)
|
||||||
except:
|
except:
|
||||||
|
raise
|
||||||
lm = 0.0
|
lm = 0.0
|
||||||
try:
|
try:
|
||||||
ti = float(ti)
|
ti = float(ti)
|
||||||
except:
|
except:
|
||||||
|
raise
|
||||||
ti = 0.0
|
ti = 0.0
|
||||||
return lm + ti
|
return lm + ti
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user