From e0d81d8404aceea26c9b2c0b8dc5d314a2baacae Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 8 Nov 2009 18:26:40 -0700 Subject: [PATCH] Fix #3964 (News scientist recipe not working) --- resources/recipes/new_scientist.recipe | 30 ++++++++------------------ setup/installer/osx/freeze.py | 2 +- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/resources/recipes/new_scientist.recipe b/resources/recipes/new_scientist.recipe index bec3f19744..a915a2dde3 100644 --- a/resources/recipes/new_scientist.recipe +++ b/resources/recipes/new_scientist.recipe @@ -12,8 +12,7 @@ class NewScientist(BasicNewsRecipe): title = 'New Scientist - Online News' __author__ = 'Darko Miletic' description = 'Science news and science articles from New Scientist.' - language = 'en' - + language = 'en' publisher = 'New Scientist' category = 'science news, science articles, science jobs, drugs, cancer, depression, computer software, sex' delay = 3 @@ -21,16 +20,14 @@ class NewScientist(BasicNewsRecipe): max_articles_per_feed = 100 no_stylesheets = True use_embedded_content = False - remove_javascript = True encoding = 'utf-8' - html2lrf_options = [ - '--comment', description - , '--category', category - , '--publisher', publisher - ] - - html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"' + conversion_options = { + 'comment' : description + , 'tags' : category + , 'publisher' : publisher + , 'language' : language + } keep_only_tags = [dict(name='div', attrs={'id':['pgtop','maincol']})] @@ -53,18 +50,9 @@ class NewScientist(BasicNewsRecipe): ] def get_article_url(self, article): - url = article.get('link', None) - raw = article.get('description', None) - rsoup = self.index_to_soup(raw) - atags = rsoup.findAll('a',href=True) - for atag in atags: - if atag['href'].startswith('http://res.feedsportal.com/viral/sendemail2.html?'): - st, sep, rest = atag['href'].partition('&link=') - real_url, sep2, drest = rest.partition('" target=') - return real_url + url = article.get('guid', None) return url def print_version(self, url): - rawurl, sep, params = url.partition('?') - return rawurl + '?full=true&print=true' + return url + '?full=true&print=true' diff --git a/setup/installer/osx/freeze.py b/setup/installer/osx/freeze.py index 281432fcf3..c62d9f7154 100644 --- a/setup/installer/osx/freeze.py +++ b/setup/installer/osx/freeze.py @@ -9,8 +9,8 @@ from setup import __version__ as VERSION, __appname__ as APPNAME, SRC, Command, try: from setuptools import setup -except: setup +except: class setup: pass