From 0a3033a213a518f1b479b36ace586c3a4f94fdc4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 14 Feb 2023 16:22:37 +0530 Subject: [PATCH] Science X by unkn0wn --- recipes/science_x.recipe | 44 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 recipes/science_x.recipe diff --git a/recipes/science_x.recipe b/recipes/science_x.recipe new file mode 100644 index 0000000000..044f95ca96 --- /dev/null +++ b/recipes/science_x.recipe @@ -0,0 +1,44 @@ +''' +https://sciencex.com/ +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class scix(BasicNewsRecipe): + title = 'Science X' + description = ( + 'Science X is a network of high-quality websites that provides the most complete and comprehensive ' + 'daily coverage of science, technology, and medical news. Articles from phys.org, medicalxpress.com' + '& techxplore.com' + ) + language = 'en' + __author__ = 'unkn0wn' + oldest_article = 1 # days + max_articles_per_feed = 50 + encoding = 'utf-8' + remove_attributes = ['height', 'width'] + ignore_duplicate_articles = {'url', 'title'} + + extra_css = ''' + #figure {text-align:center; font-size:small;} + em, blockquote {color:#202020;} + .article__info, .article-byline, .article-main__more, .d-print-block {font-size:small; color:#404040;} + ''' + + resolve_internal_links = True + remove_empty_feeds = True + + keep_only_tags = [dict(name='article', attrs={'class':'news-article'})] + + feeds = [ + ('Tech Xplore', 'https://techxplore.com/rss-feed/'), + ('Medical Xpress', 'https://medicalxpress.com/rss-feed/'), + ('Phys.org', 'https://phys.org/rss-feed/') + #https://medicalxpress.com/feeds/ + #https://techxplore.com/feeds/ + ] + + def preprocess_html(self, soup): + for figure in soup.findAll('figure'): + figure['id'] = 'figure' + return soup