From 0cab0f4fd45f07df32a4bff16189de5544a8d859 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 17 Oct 2009 10:49:23 -0600 Subject: [PATCH] New recipes for Naked Capitalism and Daily Reckoning by Darko Miletic --- resources/images/news/dailyreckoning.png | Bin 0 -> 996 bytes resources/recipes/dailyreckoning.recipe | 47 +++++++++++++++++++++++ resources/recipes/nakedcapitalism.recipe | 39 +++++++++++++++++++ src/calibre/linux.py | 3 -- 4 files changed, 86 insertions(+), 3 deletions(-) create mode 100644 resources/images/news/dailyreckoning.png create mode 100644 resources/recipes/dailyreckoning.recipe create mode 100644 resources/recipes/nakedcapitalism.recipe diff --git a/resources/images/news/dailyreckoning.png b/resources/images/news/dailyreckoning.png new file mode 100644 index 0000000000000000000000000000000000000000..64cd95d1730fe77acf52f3623e4ef2ff5be5358f GIT binary patch literal 996 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zK-vS0-A-oPfdtD69Mgd`SU*F|v9*U87?^oIT^vI!PO~1ooh=i}aNyznIj8;7%C=4R zoqhJ!7FE+_LA+dM)6DEvd^y{tu#kUWmw(g$<_G&9Jazrx+m#e5^0=8}s#eGJ2f9f; zOT6BlRNK9I@=fFE#mC-%zBjA?m78WjB=^D^uayQ-w+QxvmsUF)83_5DM6*6!N&kX5k9mWBnHOKN+X! z*aj_F)_=X_&@+zdk8>PkTzC9wuwi&8k{T5d{Gi(In#H37&KhbT51WNb|2nXNiOFEf znx*Vdo~k%sPcZ*#ptU%wX`y1It9xrc?f#vIzy8>m z$G7mmn{z?9>1p+Bo%?^=ccw3^eBssbZMkPD|3!1jRg8!74Q)I*j*3WUe|YGAf5Q%w zqbD3zOK;pe{ln#c&Rz=#6Q`WG1tpypuI&1}n!hE5&&s5Jo4Mrh`tN0eA~uz!vuaox z`Cj@Q__*)cd;6*#Rnmb`Qx-Z)SbOdDvSW&#vrw^JBKVQ{G0l=rJ*IhalS*#+zN_2k zWXf~!{DhV51)t)}+}bN1TE<8ie=@Z$J2Ex>`HfrmAKjKWyXbpTeEz$Scf%*$bYGSc z-?5=rQb^uKscl8@1@D?NH|DD3+ZBd3e~!3@?bFxLGRPCxI;#F&bw$;z==Cwr?2G3s zD?Kq?9>2e8@##m!#WAzC>*&l$D|=?+x&F!K+qd_WycXKr-|kZ}`OCHbh{&6dZatDP zkDHOGv8y8gMcLcl=`x|B$CaD66`aaWKAk+}dGbllb8RZKCGQ#@ZEWo7`ly+4#;)zf z^y6=2mfT2oextzW&}Fx&?EveRIp@Enxhb$rZJgG#Lm)n72m3w~4*gFToP^EQ3tXE6 z7fH;Js$bK&u>Zrdj|@#x>dRk59)6d=tXn%Lb8%H_Z;_CtS3rw}{3RR3?;=|p8h7{e zII*R=Wo;KwWcadq&IX%@^;7gxbnk7enhVS&swJ)wB`Jv|saDBFsX&Us$iTo-*U&)M z&^*M@z{Wf5*JG(12r&sy85}S Ib4q9e0HFc26aWAK literal 0 HcmV?d00001 diff --git a/resources/recipes/dailyreckoning.recipe b/resources/recipes/dailyreckoning.recipe new file mode 100644 index 0000000000..5522427fba --- /dev/null +++ b/resources/recipes/dailyreckoning.recipe @@ -0,0 +1,47 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2009, Darko Miletic ' +''' +dailyreckoning.com +''' +from calibre.web.feeds.news import BasicNewsRecipe + +class dailyreckoning_us(BasicNewsRecipe): + title = 'The Daily Reckoning - US edition' + __author__ = 'Darko Miletic' + description = 'Worldwide business and financial news and articles' + publisher = 'Agora Financial, LLC.' + category = 'news, business, finances, money, banking' + oldest_article = 7 + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + encoding = 'utf-8' + language = 'en' + extra_css = ' #BlogTitle{font-size: x-large; font-weight: bold} #BlogDate{font-size: small} ' + + conversion_options = { + 'comment' : description + , 'tags' : category + , 'publisher' : publisher + , 'language' : language + } + + feeds = [(u'Articles', u'http://feeds.feedburner.com/dailyreckoning?format=xml')] + + keep_only_tags = [dict(name='div', attrs={'id':'Outline'})] + + remove_tags = [ + dict(name=['object','link','base']) + ,dict(name='hr', attrs={'class':'Divider'}) + ] + + remove_tags_after = dict(name='hr', attrs={'class':'Divider'}) + + def get_article_url(self, article): + return article.get('feedburner_origlink', article.get('link')) + + def print_version(self, url): + return url + 'print/' + diff --git a/resources/recipes/nakedcapitalism.recipe b/resources/recipes/nakedcapitalism.recipe new file mode 100644 index 0000000000..09b7d8de1b --- /dev/null +++ b/resources/recipes/nakedcapitalism.recipe @@ -0,0 +1,39 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2009, Darko Miletic ' +''' +www.nakedcapitalism.com +''' +from calibre.web.feeds.news import BasicNewsRecipe + +class nakedcapitalism(BasicNewsRecipe): + title = 'Naked Capitalism' + __author__ = 'Darko Miletic' + description = 'Commentary on current economic and financial news.' + publisher = 'Aurora Advisors, Inc.' + category = 'news, business, finances, money, banking' + oldest_article = 7 + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + encoding = 'utf-8' + language = 'en' + extra_css = ' #BlogTitle{font-size: x-large; font-weight: bold} #BlogDate{font-size: small} ' + + conversion_options = { + 'comment' : description + , 'tags' : category + , 'publisher' : publisher + , 'language' : language + } + + feeds = [(u'Articles', u'http://www.nakedcapitalism.com/feed')] + + keep_only_tags = [ + dict(name='h3', attrs={'class':'post-title entry-title'}) + ,dict(name='div', attrs={'class':'entry'}) + ] + + remove_tags = [dict(name=['object','link','base'])] + diff --git a/src/calibre/linux.py b/src/calibre/linux.py index 62af807f4c..c0e76b8690 100644 --- a/src/calibre/linux.py +++ b/src/calibre/linux.py @@ -172,8 +172,6 @@ class PostInstall: from calibre.ebooks.metadata.cli import option_parser as metaop, filetypes as meta_filetypes from calibre.ebooks.lrf.lrfparser import option_parser as lrf2lrsop from calibre.gui2.lrf_renderer.main import option_parser as lrfviewerop - from calibre.web.fetch.simple import option_parser as web2disk - from calibre.web.feeds.recipes import titles as feed_titles from calibre.ebooks.metadata.fetch import option_parser as fem_op from calibre.gui2.main import option_parser as guiop from calibre.utils.smtp import option_parser as smtp_op @@ -195,7 +193,6 @@ class PostInstall: f.write(opts_and_exts('lrf2lrs', lrf2lrsop, ['lrf'])) f.write(opts_and_exts('ebook-meta', metaop, list(meta_filetypes()))) f.write(opts_and_exts('lrfviewer', lrfviewerop, ['lrf'])) - f.write(opts_and_words('web2disk', web2disk, feed_titles)) f.write(opts_and_words('fetch-ebook-metadata', fem_op, [])) f.write(opts_and_words('calibre-smtp', smtp_op, [])) f.write(textwrap.dedent('''