| 1 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 2 |
|
| 3 |
|
| 4 |
class AdvancedUserRecipe1450864843(BasicNewsRecipe): |
| 5 |
title = 'Tagesanzeiger' |
| 6 |
__author__ = 'noxxx' |
| 7 |
language = 'de' |
| 8 |
oldest_article = 1 |
| 9 |
max_articles_per_feed = 8 |
| 10 |
no_stylesheets = True |
| 11 |
auto_cleanup = True |
| 12 |
scale_news_images_to_device = True |
| 13 |
compress_news_images = True |
| 14 |
remove_javascript = True |
| 15 |
encoding = 'utf-8' |
| 16 |
remove_empty_feeds = True |
| 17 |
ignore_duplicate_articles = {'title', 'url'} |
| 18 |
|
| 19 |
feeds = [ |
| 20 |
('Front', 'http://www.tagesanzeiger.ch/rss.html'), |
| 21 |
('Zurich', 'http://www.tagesanzeiger.ch/zuerich/rss.html'), |
| 22 |
('Schweiz', 'http://www.tagesanzeiger.ch/schweiz/rss.html'), |
| 23 |
('International', 'http://www.tagesanzeiger.ch/ausland/rss.html'), |
| 24 |
('Wirtschaft', 'http://www.tagesanzeiger.ch/wirtschaft/rss.html'), |
| 25 |
('Sport', 'http://www.tagesanzeiger.ch/sport/rss.html'), |
| 26 |
('Kultur', 'http://www.tagesanzeiger.ch/kultur/rss.html'), |
| 27 |
('Leben', 'http://www.tagesanzeiger.ch/leben/rss.html'), |
| 28 |
('Panorama', 'http://www.tagesanzeiger.ch/panorama/rss.html'), |
| 29 |
('Digital', 'http://www.tagesanzeiger.ch/digital/rss.html'), |
| 30 |
] |
| 31 |
|
| 32 |
keep_only_tags = [dict(name='h1'), dict(name='h3'), dict(name='div', attrs={'id': 'topElement'}), dict(name='div', attrs={'id': 'mainContent'})] |
| 33 |
|
| 34 |
auto_cleanup_keep = {'//div[@id="article-image"]', '//*[@class="standard"]'} |
| 35 |
|
| 36 |
conversion_options = {'base_font_size': 12} |
| 37 |
|
| 38 |
extra_css = '''h1 { font-size: 150%; font-weight: bold; } |
| 39 |
h2 { font-size: 120%; font-weight: bold; } |
| 40 |
h3 { font-size: 100%; font-style: italic; } |
| 41 |
h4, h5, h6 { font-size: 100%; font-style: italic; }''' |
| 42 |
|
| 43 |
def get_cover_url(self): |
| 44 |
self.cover_url = 'http://newsmail.cleartext.ch/referenz_tagesanzeiger.jpg' |
| 45 |
return getattr(self, 'cover_url', None) |