| 1 |
# -*- coding: utf-8 -*- |
| 2 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 3 |
|
| 4 |
|
| 5 |
class AntywebRecipe(BasicNewsRecipe): |
| 6 |
encoding = 'utf-8' |
| 7 |
__license__ = 'GPL v3' |
| 8 |
__author__ = 'Artur Stachecki <[email protected]>, adrianf0' |
| 9 |
language = 'pl' |
| 10 |
version = 1 |
| 11 |
title = 'Antyweb' |
| 12 |
category = 'News' |
| 13 |
description = 'Blog o internecie i nowych technologiach' |
| 14 |
cover_url = '' |
| 15 |
remove_empty_feeds = True |
| 16 |
auto_cleanup = False |
| 17 |
no_stylesheets = True |
| 18 |
use_embedded_content = False |
| 19 |
oldest_article = 7 |
| 20 |
max_articles_per_feed = 100 |
| 21 |
remove_javascript = True |
| 22 |
simultaneous_downloads = 10 |
| 23 |
# zignoruj zduplikowane artykuły o takich samych tytułach LUB adresach |
| 24 |
ignore_duplicate_articles = {'title', 'url'} |
| 25 |
scale_news_images = True |
| 26 |
conversion_options = { |
| 27 |
'tags': 'news, aplikacje mobilne, Android, iOS, Windows Phone ', |
| 28 |
'smarten_punctuation': True, |
| 29 |
'publisher': 'AntyWeb', |
| 30 |
} # opcje konwersji. |
| 31 |
|
| 32 |
keep_only_tags = [] |
| 33 |
keep_only_tags.append(dict(name='h1')) |
| 34 |
keep_only_tags.append(dict(name='section', attrs={'class': 'article'})) |
| 35 |
remove_tags = [] |
| 36 |
remove_tags.append(dict(name='div', attrs={'class': 'ac-footer group'})) |
| 37 |
|
| 38 |
feeds = [ |
| 39 |
('News', 'http://feeds.feedburner.com/antyweb'), |
| 40 |
('Felietony', 'http://feeds.feedburner.com/AntywebFelietony'), |
| 41 |
('Apple', 'http://feeds.feedburner.com/AntywebApple'), |
| 42 |
('Gry', 'http://feeds.feedburner.com/AntywebGry'), |
| 43 |
('Mobile', 'http://feeds.feedburner.com/AntywebMobile'), |
| 44 |
('Startups', 'http://feeds.feedburner.com/AntywebStartups'), |
| 45 |
('Google', 'http://feeds.feedburner.com/AntywebGoogle'), |
| 46 |
('Microsoft', 'http://feeds.feedburner.com/AntywebMicrosoft'), |
| 47 |
] |
| 48 |
|
| 49 |
def preprocess_html(self, soup): |
| 50 |
for alink in soup.findAll('a'): |
| 51 |
if alink.string is not None: |
| 52 |
tstr = alink.string |
| 53 |
alink.replaceWith(tstr) |
| 54 |
return soup |