| 1 |
# -*- coding: utf-8 -*- |
| 2 |
__license__ = 'GPL v3' |
| 3 |
__copyright__ = '2011 Aurélien Chabot <[email protected]>' |
| 4 |
|
| 5 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 6 |
|
| 7 |
|
| 8 |
class Phoronix(BasicNewsRecipe): |
| 9 |
title = 'Phoronix' |
| 10 |
__author__ = 'calibre' |
| 11 |
description = 'Linux hardware reviews, performance benchmarks and open-source news' |
| 12 |
encoding = 'utf-8' |
| 13 |
publisher = 'Phoronix.com' |
| 14 |
category = 'news, IT, linux' |
| 15 |
language = 'en' |
| 16 |
|
| 17 |
use_embedded_content = False |
| 18 |
timefmt = ' [%d %b %Y]' |
| 19 |
max_articles_per_feed = 40 |
| 20 |
no_stylesheets = True |
| 21 |
remove_empty_feeds = True |
| 22 |
filterDuplicates = True |
| 23 |
delay = 1 |
| 24 |
|
| 25 |
feeds = [('Phoronix', 'https://www.phoronix.com/rss.php')] |
| 26 |
|
| 27 |
keep_only_tags = [dict(name='article', attrs={'class': 'full'})] |
| 28 |
browser_type = 'webengine' |
| 29 |
|
| 30 |
remove_tags = [ |
| 31 |
dict(attrs={'id': lambda x: x and 'leaderboard' in x}), |
| 32 |
dict(attrs={'id': 'sharebar'}), |
| 33 |
dict(attrs={'id': 'about-author'}), |
| 34 |
dict(attrs={'class': 'foot'}), |
| 35 |
dict(attrs={'class': 'article-box'}), |
| 36 |
dict(attrs={'class': 'after-article'}), |
| 37 |
dict(attrs={'class': 'comments-label'}), |
| 38 |
dict(attrs={'class': 'pagination'}), |
| 39 |
] |
| 40 |
|
| 41 |
extra_css = ''' |
| 42 |
h1 { font-size: xx-large; font-family: Arial, Helvetica, sans-serif; } |
| 43 |
.author { font-size: small; color: #555; font-family: Arial, Helvetica, sans-serif; } |
| 44 |
.content { font-size: medium; font-family: Arial, Helvetica, sans-serif; } |
| 45 |
''' |
| 46 |
|
| 47 |
def preprocess_html(self, soup): |
| 48 |
for item in soup.findAll(style=True): |
| 49 |
del item['style'] |
| 50 |
return soup |