| 1 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 2 |
|
| 3 |
|
| 4 |
class RzeczpospolitaRecipe(BasicNewsRecipe): |
| 5 |
__license__ = 'GPL v3' |
| 6 |
__author__ = 'kwetal, Tomasz Dlugosz, adrianf0' |
| 7 |
language = 'pl' |
| 8 |
|
| 9 |
title = 'Rzeczpospolita OnLine' |
| 10 |
publisher = 'Presspublica Sp.' |
| 11 |
category = 'News' |
| 12 |
description = 'Newspaper' |
| 13 |
oldest_article = 1 |
| 14 |
max_articles_per_feed = 100 |
| 15 |
|
| 16 |
no_stylesheets = True |
| 17 |
remove_javascript = True |
| 18 |
# Seems to work best, but YMMV |
| 19 |
simultaneous_downloads = 5 |
| 20 |
|
| 21 |
feeds = [] |
| 22 |
feeds.append(('WiadomoĊci', 'http://www.rp.pl/rss/1056')) # Wydarzenia |
| 23 |
feeds.append(('Ekonomia', 'http://www.rp.pl/rss/1004')) # Ekonomia |
| 24 |
feeds.append(('Prawo', 'http://www.rp.pl/rss/1037')) # Prawo |
| 25 |
|
| 26 |
keep_only_tags = [] |
| 27 |
keep_only_tags.append(dict(name='h1', attrs={'id': 'article-title'})) |
| 28 |
keep_only_tags.append(dict(name='img', attrs={'class': 'img-responsive article__image'})) |
| 29 |
keep_only_tags.append( |
| 30 |
dict( |
| 31 |
name='div', |
| 32 |
attrs={ |
| 33 |
'class': ['article-content', 'article__lead js-voice-read', 'article__content js-voice-read', 'article__image-desc', 'article__image-author'] |
| 34 |
}, |
| 35 |
) |
| 36 |
) |
| 37 |
|
| 38 |
remove_tags = [] |
| 39 |
remove_tags.append(dict(name='div', attrs={'class': 'related-articles__wrapper'})) |
| 40 |
remove_tags.append(dict(name='span', attrs={'class': ['article__premium-player', 'ad-label']})) |
| 41 |
|
| 42 |
extra_css = ''' |
| 43 |
div.article__image-desc {font-style:italic; font-size:70%;text-align:right} |
| 44 |
div.article__image-author {font-size:60%;text-align:right} |
| 45 |
''' |