|
|
#1 |
|
Junior Member
![]() Posts: 7
Karma: 10
Join Date: Oct 2024
Device: Supernote Manta
|
Phoronix Updated Recipe
The old feed was from feedburner, added the direct one.
Code:
# -*- coding: utf-8 -*-
__license__ = 'GPL v3'
__copyright__ = '2011 Aurélien Chabot <contact@aurelienchabot.fr>'
from calibre.web.feeds.news import BasicNewsRecipe
class Phoronix(BasicNewsRecipe):
title = 'Phoronix'
__author__ = 'calibre'
description = 'Linux hardware reviews, performance benchmarks and open-source news'
encoding = 'utf-8'
publisher = 'Phoronix.com'
category = 'news, IT, linux'
language = 'en'
use_embedded_content = False
timefmt = ' [%d %b %Y]'
max_articles_per_feed = 40
no_stylesheets = True
remove_empty_feeds = True
filterDuplicates = True
feeds = [('Phoronix', 'https://www.phoronix.com/rss.php')]
keep_only_tags = [dict(name='article', attrs={'class': 'full'})]
remove_tags = [
dict(attrs={'id': lambda x: x and 'leaderboard' in x}),
dict(attrs={'id': 'sharebar'}),
dict(attrs={'id': 'about-author'}),
dict(attrs={'class': 'foot'}),
dict(attrs={'class': 'article-box'}),
dict(attrs={'class': 'after-article'}),
dict(attrs={'class': 'comments-label'}),
dict(attrs={'class': 'pagination'}),
]
extra_css = '''
h1 { font-size: xx-large; font-family: Arial, Helvetica, sans-serif; }
.author { font-size: small; color: #555; font-family: Arial, Helvetica, sans-serif; }
.content { font-size: medium; font-family: Arial, Helvetica, sans-serif; }
'''
def get_browser(self):
br = BasicNewsRecipe.get_browser(self)
br.addheaders = [('User-Agent',
'Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0')]
return br
def preprocess_html(self, soup):
for item in soup.findAll(style=True):
del item['style']
return soup
|
|
|
|
|
|
#2 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46,346
Karma: 29630884
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
|
|
|
| Advert | |
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| New recipe for RedaktionsNetzwerk Deutschland, updated recipe for saechsische.de | epubli | Recipes | 0 | 09-27-2024 12:53 PM |
| Updated recipe for spektrum.de | epubli | Recipes | 1 | 11-06-2021 10:15 PM |
| Updated RealClear*.com Recipe | TechnoCat | Recipes | 0 | 04-01-2012 08:28 PM |
| Updated recipe for Le Monde? | veezh | Recipes | 5 | 01-20-2011 09:06 PM |
| One new recipe and other one updated (In Spanish) | desUBIKado | Recipes | 3 | 01-19-2011 03:58 AM |