| 1 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 2 |
|
| 3 |
|
| 4 |
class MyAppleRecipe(BasicNewsRecipe): |
| 5 |
__license__ = 'GPL v3' |
| 6 |
__author__ = 'Artur Stachecki <[email protected]>' |
| 7 |
language = 'pl' |
| 8 |
|
| 9 |
title = 'MyApple.pl' |
| 10 |
category = 'News' |
| 11 |
description = ' Największy w Polsce serwis zajmujący się tematyką związaną z Apple i wszelkimi produktami tej firmy.' |
| 12 |
cover_url = '' |
| 13 |
remove_empty_feeds = True |
| 14 |
oldest_article = 7 |
| 15 |
max_articles_per_feed = 100000 |
| 16 |
recursions = 0 |
| 17 |
|
| 18 |
no_stylesheets = True |
| 19 |
remove_javascript = True |
| 20 |
simultaneous_downloads = 3 |
| 21 |
|
| 22 |
keep_only_tags = [dict(name='article')] |
| 23 |
|
| 24 |
remove_tags = [dict(name='a', attrs={'class': 'twitter-follow-button'}), dict(name='ul', attrs={'class': 'list-inline text-muted small mb-0 mt-1'})] |
| 25 |
|
| 26 |
extra_css = ''' |
| 27 |
body {font-family: verdana, arial, helvetica, geneva, sans-serif ;} |
| 28 |
td.contentheading{font-size: large; font-weight: bold;} |
| 29 |
''' |
| 30 |
|
| 31 |
feeds = [ |
| 32 |
('Wpisy', 'https://myapple.pl/posts.atom'), |
| 33 |
] |
| 34 |
|
| 35 |
def preprocess_html(self, soup): |
| 36 |
for alink in soup.findAll('a'): |
| 37 |
if alink.string is not None: |
| 38 |
tstr = alink.string |
| 39 |
alink.replaceWith(tstr) |
| 40 |
return soup |