From 15c5ad672ca004b3f95c9a8ce252056a2f71c28e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Chabot?= Date: Sun, 16 Oct 2011 11:28:39 +0200 Subject: [PATCH] Add phoronix blog/news website recipe --- recipes/phoronix.recipe | 46 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 recipes/phoronix.recipe diff --git a/recipes/phoronix.recipe b/recipes/phoronix.recipe new file mode 100644 index 0000000000..3d3397d61f --- /dev/null +++ b/recipes/phoronix.recipe @@ -0,0 +1,46 @@ +__license__ = 'GPL v3' +__copyright__ = '2011 Aurélien Chabot ' + +''' +Fetch phoronix.com +''' + +from calibre.web.feeds.news import BasicNewsRecipe + + +class cdnet(BasicNewsRecipe): + + title = 'Phoronix' + __author__ = 'calibre' + description = 'Actualités Phoronix' + encoding = 'utf-8' + publisher = 'Phoronix.com' + category = 'news, IT, linux' + language = 'en' + + use_embedded_content = False + timefmt = ' [%d %b %Y]' + max_articles_per_feed = 25 + no_stylesheets = True + remove_empty_feeds = True + filterDuplicates = True + + extra_css = ''' + h1 {font-size:xx-large; font-family:Arial,Helvetica,sans-serif;} + h2 {font-size:xx-small; color:#4D4D4D; font-family:Arial,Helvetica,sans-serif;} + .KonaBody {font-size:medium; font-family:Arial,Helvetica,sans-serif;} + ''' + + remove_tags = [] + + remove_tags_before = dict(id='phxcms_content_phx') + remove_tags_after = dict(name='div', attrs={'class':'KonaBody'}) + + feeds = [('Phoronix', 'http://feeds.feedburner.com/Phoronix')] + + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + return soup +