From 4da86c99cb5c10f9249a875e01cd07c18bd983ea Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 21 Dec 2011 00:09:55 +0530 Subject: [PATCH] Fix #906935 (Updated recipe for moneynews.com) --- recipes/icons/moneynews.png | Bin 0 -> 914 bytes recipes/moneynews.recipe | 60 +++++++++++++++++------------------- 2 files changed, 29 insertions(+), 31 deletions(-) create mode 100644 recipes/icons/moneynews.png diff --git a/recipes/icons/moneynews.png b/recipes/icons/moneynews.png new file mode 100644 index 0000000000000000000000000000000000000000..b6ebdd5484155b0e55bbdd405b5431b98b8fe35e GIT binary patch literal 914 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl4m>B|mLR^7d28MHc_kREX|9?-< z^Wx&?ii+o)oUW~1`~KXy@AvNg4+^^X{{4SL!)tTqycZBS2Ub5yjE2B42?5*6vS^@J zd_7$pLn`Lvo;}UipdjEJ_~283!_WWwLw!t2lEf!J(^+zopr07ZaG AAOHXW literal 0 HcmV?d00001 diff --git a/recipes/moneynews.recipe b/recipes/moneynews.recipe index 8d879945dd..5c51e6aa28 100644 --- a/recipes/moneynews.recipe +++ b/recipes/moneynews.recipe @@ -1,9 +1,7 @@ -#!/usr/bin/env python - __license__ = 'GPL v3' -__copyright__ = '2009, Darko Miletic ' +__copyright__ = '2009-2011, Darko Miletic ' ''' -moneynews.newsmax.com +www.moneynews.com ''' from calibre.web.feeds.news import BasicNewsRecipe @@ -12,40 +10,40 @@ class MoneyNews(BasicNewsRecipe): title = 'Moneynews.com' __author__ = 'Darko Miletic' description = 'Financial news worldwide' - publisher = 'moneynews.com' - language = 'en' - + publisher = 'Newsmax.com' + language = 'en' category = 'news, finances, USA, business' oldest_article = 2 max_articles_per_feed = 100 no_stylesheets = True use_embedded_content = False - encoding = 'cp1252' - - html2lrf_options = [ - '--comment', description - , '--category', category - , '--publisher', publisher - , '--ignore-tables' - ] - - html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"\nlinearize_tables=True' - + encoding = 'utf8' + extra_css = 'img{display: block} body{font-family: Arial, Helvetica, sans-serif}' + + conversion_options = { + 'comment' : description + , 'tags' : category + , 'publisher' : publisher + , 'language' : language + , 'linearize_tables' : True + } + feeds = [ - (u'Street Talk' , u'http://moneynews.newsmax.com/xml/streettalk.xml' ) - ,(u'Finance News' , u'http://moneynews.newsmax.com/xml/FinanceNews.xml' ) - ,(u'Economy' , u'http://moneynews.newsmax.com/xml/economy.xml' ) - ,(u'Companies' , u'http://moneynews.newsmax.com/xml/companies.xml' ) - ,(u'Markets' , u'http://moneynews.newsmax.com/xml/Markets.xml' ) - ,(u'Investing & Analysis' , u'http://moneynews.newsmax.com/xml/investing.xml' ) + (u'Street Talk' , u'http://www.moneynews.com/rss/StreetTalk/8.xml' ) + ,(u'Finance News' , u'http://www.moneynews.com/rss/FinanceNews/4.xml' ) + ,(u'Economy' , u'http://www.moneynews.com/rss/Economy/2.xml' ) + ,(u'Companies' , u'http://www.moneynews.com/rss/Companies/6.xml' ) + ,(u'Markets' , u'http://www.moneynews.com/rss/Markets/7.xml' ) + ,(u'Investing & Analysis' , u'http://www.moneynews.com/rss/InvestingAnalysis/17.xml') ] - - keep_only_tags = [dict(name='table', attrs={'class':'copy'})] - + keep_only_tags = [dict(name='div', attrs={'class':'copy'})] + remove_tags = [ - dict(name='td' , attrs={'id':'article_fontsize'}) - ,dict(name='table', attrs={'id':'toolbox' }) - ,dict(name='tr' , attrs={'id':'noprint3' }) + dict(attrs={'class':['MsoNormal', 'MsoNoSpacing']}), + dict(name=['object','link','embed','form','meta']) ] - + + def print_version(self, url): + nodeid = url.rpartition('/')[2] + return 'http://www.moneynews.com/PrintTemplate?nodeid=' + nodeid