From 217c7dd93573257bfc4ab5809aec945ac0b2866d Mon Sep 17 00:00:00 2001 From: Allan Simonsen Date: Sun, 2 Oct 2016 15:19:51 +0200 Subject: [PATCH] Fixed bug #1458142: Recipe sciencedaily.recipe now works again. --- recipes/sciencedaily.recipe | 48 +++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/recipes/sciencedaily.recipe b/recipes/sciencedaily.recipe index bcc080d712..56e2200ede 100644 --- a/recipes/sciencedaily.recipe +++ b/recipes/sciencedaily.recipe @@ -1,36 +1,38 @@ #!/usr/bin/env python2 - +from calibre.web.feeds.news import BasicNewsRecipe __license__ = 'GPL v3' __copyright__ = '2008, Darko Miletic ' ''' sciencedaily.com ''' -from calibre.web.feeds.news import BasicNewsRecipe class ScienceDaily(BasicNewsRecipe): title = u'ScienceDaily' __author__ = u'Darko Miletic' - description = u"Breaking science news and articles on global warming, extrasolar planets, stem cells, bird flu, autism, nanotechnology, dinosaurs, evolution -- the latest discoveries in astronomy, anthropology, biology, chemistry, climate & environment, computers, engineering, health & medicine, math, physics, psychology, technology, and more -- from the world's leading universities and research organizations." # noqa - oldest_article = 7 - language = 'en' + title = 'ScienceDaily' + description = ('ScienceDaily is one of the Internet’s most popular ' + 'science news web sites. Since starting in 1995, the ' + 'award-winning site has earned the loyalty of students, ' + 'researchers, healthcare professionals, government ' + 'agencies, educators and the general public around the ' + 'world. Now with more than 6 million monthly visitors ' + 'worldwide, ScienceDaily generates nearly 20 million ' + 'page views a month and is steadily growing in its ' + 'global audience.') + category = 'medicin, healthcare' + oldest_article = 7 + max_articles_per_feed = 50 + auto_cleanup = True + language = 'en' - max_articles_per_feed = 150 - no_stylesheets = True - use_embedded_content = False - - cover_url = 'http://www.sciencedaily.com/images/logo.gif' - - keep_only_tags = [ - dict(name='h1', attrs={'class': 'story'}), dict( - name='div', attrs={'id': 'story'}) + # Feed are found here: https://www.sciencedaily.com/newsfeeds.htm + feeds = [ + ('Latest Science News', 'https://rss.sciencedaily.com/top.xml'), + ('All Top News', 'https://rss.sciencedaily.com/top/science.xml'), + ('Health News', 'https://rss.sciencedaily.com/top/health.xml'), + ('Technology News', 'https://rss.sciencedaily.com/top/technology.xml'), + ('Environment News', 'https://rss.sciencedaily.com/top/environment.xml'), + ('Society News', 'https://rss.sciencedaily.com/top/society.xml'), + ('Strange & Offbeat News', 'https://rss.sciencedaily.com/strange_offbeat.xml'), ] - # @@@ float: righr; width: 500px (wtf) - remove_attributes = ['style', 'width'] - remove_tags_after = dict(name='div', attrs={'id': 'citations'}) - remove_tags = [ - dict(name='div', attrs={'id': 'sharing'}), dict(name='div', attrs={'id': 'citations'}), dict( - name='div', attrs={'class': 'overlay'}), dict(name='a', attrs={'class': 'image'}) - ] - - feeds = [(u"ScienceDaily", u'http://www.sciencedaily.com/newsfeed.xml')]