| 1 |
#!/usr/bin/env python |
| 2 |
|
| 3 |
__license__ = 'GPL v3' |
| 4 |
__copyright__ = 'teepel' |
| 5 |
|
| 6 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 7 |
|
| 8 |
|
| 9 |
class media2_pl(BasicNewsRecipe): |
| 10 |
title = 'Media2' |
| 11 |
__author__ = 'teepel <[email protected]>' |
| 12 |
language = 'pl' |
| 13 |
description = 'Media2.pl to jeden z najczęściej odwiedzanych serwisów dla profesjonalistów z branży medialnej, telekomunikacyjnej, public relations oraz nowych technologii.' # noqa: E501 |
| 14 |
masthead_url = 'http://media2.pl/res/logo/www.png' |
| 15 |
cover_url = 'http://media2.pl/res/logo/www.png' |
| 16 |
INDEX = 'http://media2.pl' |
| 17 |
remove_empty_feeds = True |
| 18 |
oldest_article = 7 |
| 19 |
max_articles_per_feed = 100 |
| 20 |
remove_javascript = True |
| 21 |
no_stylesheets = True |
| 22 |
remove_attributes = ['style'] |
| 23 |
ignore_duplicate_articles = {'title', 'url'} |
| 24 |
extra_css = '''.news-lead{font-weight: bold; }''' |
| 25 |
|
| 26 |
keep_only_tags = [dict(name='div', attrs={'class': 'news-item tpl-big'})] |
| 27 |
remove_tags = [ |
| 28 |
dict(name='span', attrs={'class': 'news-comments'}), |
| 29 |
dict(name='div', attrs={'class': ['item-sidebar', 'news-inline-promo nobbtext']}), |
| 30 |
dict(name='div', attrs={'class': 'news-tags'}), |
| 31 |
] |
| 32 |
|
| 33 |
feeds = [ |
| 34 |
('Media2', 'http://feeds.feedburner.com/media2'), |
| 35 |
('Internet', 'http://feeds.feedburner.com/media2/internet'), |
| 36 |
('Media', 'http://feeds.feedburner.com/media2/media'), |
| 37 |
('Telekomunikacja', 'http://feeds.feedburner.com/media2/telekomunikacja'), |
| 38 |
('Reklama/PR', 'http://feeds.feedburner.com/media2/reklama-pr'), |
| 39 |
('Technologie', 'http://feeds.feedburner.com/media2/technologie'), |
| 40 |
('Badania', 'http://feeds.feedburner.com/media2/badania'), |
| 41 |
] |
| 42 |
|
| 43 |
def image_url_processor(self, baseurl, url): |
| 44 |
if url[0] == '/': |
| 45 |
url = self.INDEX + url |
| 46 |
return url |