| 1 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 2 |
|
| 3 |
|
| 4 |
class AdvancedUserRecipe1305547242(BasicNewsRecipe): |
| 5 |
title = 'Good House Keeping' |
| 6 |
language = 'en' |
| 7 |
__author__ = 'Anonymous' |
| 8 |
oldest_article = 7 |
| 9 |
max_articles_per_feed = 100 |
| 10 |
no_stylesheets = True |
| 11 |
use_embedded_content = False |
| 12 |
remove_javascript = True |
| 13 |
|
| 14 |
def print_version(self, url): |
| 15 |
if '/tips-for-making-desserts?' in url: |
| 16 |
return None |
| 17 |
segments = url.split('/') |
| 18 |
segments[-1] = segments[-1].split('?')[0] |
| 19 |
segments[-1] += '?page=all' |
| 20 |
printURL = '/'.join(segments[0:3]) + '/print-this/' + segments[-1] |
| 21 |
return printURL |
| 22 |
|
| 23 |
def preprocess_html(self, soup): |
| 24 |
for alink in soup.findAll('a'): |
| 25 |
if alink.string is not None: |
| 26 |
tstr = alink.string |
| 27 |
alink.replaceWith(tstr) |
| 28 |
return soup |
| 29 |
|
| 30 |
feeds = [ |
| 31 |
('Food and Recipes', 'http://www.goodhousekeeping.com/rss/recipes/'), |
| 32 |
('Home and Organizing', 'http://www.goodhousekeeping.com/rss/home/'), |
| 33 |
('Diet and Health', 'http://www.goodhousekeeping.com/rss/health/'), |
| 34 |
('Beauty and Anti-Aging', 'http://www.goodhousekeeping.com/rss/beauty/'), |
| 35 |
('Family and Relationships', 'http://www.goodhousekeeping.com/rss/family/'), |
| 36 |
('Holidays', 'http://www.goodhousekeeping.com/rss/holidays/'), |
| 37 |
('In the Test Kitchen', 'http://www.goodhousekeeping.com/rss/test-kitchen-blog/'), |
| 38 |
] |