| 1 |
import re |
| 2 |
|
| 3 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 4 |
|
| 5 |
|
| 6 |
class WNP(BasicNewsRecipe): |
| 7 |
title = 'WNP' |
| 8 |
cover_url = 'http://k.wnp.pl/images/wnpLogo.gif' |
| 9 |
__author__ = 'fenuks' |
| 10 |
description = 'Wirtualny Nowy Przemysł' |
| 11 |
category = 'economy' |
| 12 |
language = 'pl' |
| 13 |
preprocess_regexps = [ |
| 14 |
(re.compile('Czytaj też:.*?</a>', re.DOTALL), lambda match: ''), # noqa: RUF039 |
| 15 |
(re.compile(r'Czytaj więcej:.*?</a>', re.DOTALL), lambda match: ''), |
| 16 |
] # noqa: RUF039 |
| 17 |
oldest_article = 8 |
| 18 |
max_articles_per_feed = 100 |
| 19 |
no_stylesheets = True |
| 20 |
remove_tags = [dict(attrs={'class': ['printF', 'border3B2 clearfix', 'articleMenu clearfix']})] |
| 21 |
feeds = [ |
| 22 |
('Wiadomości gospodarcze', 'http://www.wnp.pl/rss/serwis_rss.xml'), |
| 23 |
('Serwis Energetyka - Gaz', 'http://www.wnp.pl/rss/serwis_rss_1.xml'), |
| 24 |
('Serwis Nafta - Chemia', 'http://www.wnp.pl/rss/serwis_rss_2.xml'), |
| 25 |
('Serwis Hutnictwo', 'http://www.wnp.pl/rss/serwis_rss_3.xml'), |
| 26 |
('Serwis Górnictwo', 'http://www.wnp.pl/rss/serwis_rss_4.xml'), |
| 27 |
('Serwis Logistyka', 'http://www.wnp.pl/rss/serwis_rss_5.xml'), |
| 28 |
('Serwis IT', 'http://www.wnp.pl/rss/serwis_rss_6.xml'), |
| 29 |
] |
| 30 |
|
| 31 |
def print_version(self, url): |
| 32 |
return 'http://wnp.pl/drukuj/' + url[url.find(',') + 1 :] |