| 1 |
import re |
| 2 |
|
| 3 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 4 |
|
| 5 |
|
| 6 |
class AdvancedUserRecipe1289939440(BasicNewsRecipe): |
| 7 |
__author__ = 'FunThomas' |
| 8 |
title = 'Root.cz' |
| 9 |
description = 'Zprávičky a články z Root.cz' |
| 10 |
publisher = 'Internet Info, s.r.o' |
| 11 |
oldest_article = 2 # max stari clanku ve dnech |
| 12 |
max_articles_per_feed = 50 # max pocet clanku na feed |
| 13 |
|
| 14 |
feeds = [('Články', 'http://www.root.cz/rss/clanky/'), ('Zprávičky', 'http://www.root.cz/rss/zpravicky/')] |
| 15 |
|
| 16 |
publication_type = 'magazine' |
| 17 |
language = 'cs' |
| 18 |
no_stylesheets = True |
| 19 |
remove_javascript = True |
| 20 |
cover_url = 'http://i.iinfo.cz/urs/logo-root-bila-oranzova-cerna-111089527143118.gif' |
| 21 |
|
| 22 |
remove_attributes = ['width', 'height', 'href'] # ,'href' |
| 23 |
keep_only_tags = [ |
| 24 |
dict(name='h1'), |
| 25 |
dict(name='a', attrs={'class': 'author'}), |
| 26 |
dict(name='p', attrs={'class': 'intro'}), |
| 27 |
dict(name='div', attrs={'class': 'urs'}), |
| 28 |
] |
| 29 |
|
| 30 |
preprocess_regexps = [ |
| 31 |
(re.compile(r'<p class="perex[^"]*">[^<]*<img[^>]*>', re.DOTALL), lambda match: '<p class="intro">'), |
| 32 |
( |
| 33 |
re.compile( |
| 34 |
'<h3><a name="tucnak">Tričko tučňák.*</body>', # noqa: RUF039 |
| 35 |
re.DOTALL, |
| 36 |
), |
| 37 |
lambda match: '<!--deleted-->', |
| 38 |
), |
| 39 |
] |
| 40 |
|
| 41 |
extra_css = ''' |
| 42 |
h1 {font-size:130%; font-weight:bold} |
| 43 |
h3 {font-size:111%; font-weight:bold} |
| 44 |
''' |