From 763fc22bd43d2ab7056ee2df63fb4176a51c9aa5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 27 Feb 2009 16:47:34 -0800 Subject: [PATCH] New recipe for The Onion, by Darko Miletic --- src/calibre/gui2/images/news/theonion.png | Bin 0 -> 804 bytes src/calibre/web/feeds/recipes/__init__.py | 2 +- .../web/feeds/recipes/recipe_theonion.py | 45 ++++++++++++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 src/calibre/gui2/images/news/theonion.png create mode 100644 src/calibre/web/feeds/recipes/recipe_theonion.py diff --git a/src/calibre/gui2/images/news/theonion.png b/src/calibre/gui2/images/news/theonion.png new file mode 100644 index 0000000000000000000000000000000000000000..d29c69562d7a8b60baf908b5e80557b235a0ef19 GIT binary patch literal 804 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zK-vS0-A-oPfdtD69Mgd`SU*F|v9*U87?^xLT^vI!PEVce=n-5fbKE|^Z%*>$?VD;? z4li76&XU;{bY#Jz!!{CeEN{2)HBEQi{Zetlfx|6)!exTCTY_2RFm=L0Qn99$LpBLA&Qsq(RJ3l&{cL|^YXRPa0ZnAvlc2O!j|+EwFxmNL8DGN`Dd9|8_dD{ck(WAt zFFx~L&$~1S+?tn#)!t?vpaYNP=*d#p5E^O(!+ zYR-q#j0sn@o}ATfTR->QHlQyisq!w3O#6Ld0^9YpCFQ?gKj$fD_~vtRk{aWhFTR{_ zzpMAGI$3hPBlm;$V`j(gMREcYueP}_&NAA+`%Lmvy~VFL2YK~&x)?fNSi2x*(#wpU zRcsHq7n+=2a%D!u%h^D0u{FfqReurYvSf6H3Sa&eZCzQhvpwDZod>ix)^Tjr1iEetz#E_WZ{`PF!(#b!{7Ad{! zzh%kG(0{r0lFsK9Z^f!g=Rfi1T^+VCujq(4P||3JS#o*4#KY3_!HfpG?6TE?PGRs6 zG3Iss>U;P9pO{H{zviAlX5U%;j;YRXCl4@{sg}4#lq46WCYGe?rT_^BBLf3VT>~Rs zBa09N11l3lD`Nv~Aj7~wFZ7oMOhaydN@iLmrUo-BLlY|_3y6lDR#kdH4Gf;HelF{r G5}E*}k5M-O literal 0 HcmV?d00001 diff --git a/src/calibre/web/feeds/recipes/__init__.py b/src/calibre/web/feeds/recipes/__init__.py index 7821154432..6018af4918 100644 --- a/src/calibre/web/feeds/recipes/__init__.py +++ b/src/calibre/web/feeds/recipes/__init__.py @@ -32,7 +32,7 @@ recipe_modules = ['recipe_' + r for r in ( 'hindu', 'cincinnati_enquirer', 'physics_world', 'pressonline', 'la_republica', 'physics_today', 'chicago_tribune', 'e_novine', 'al_jazeera', 'winsupersite', 'borba', 'courrierinternational', - 'lamujerdemivida', 'soldiers', + 'lamujerdemivida', 'soldiers', 'theonion', )] import re, imp, inspect, time, os diff --git a/src/calibre/web/feeds/recipes/recipe_theonion.py b/src/calibre/web/feeds/recipes/recipe_theonion.py new file mode 100644 index 0000000000..06f7edd32b --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_theonion.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2009, Darko Miletic ' + +''' +theonion.com +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class TheOnion(BasicNewsRecipe): + title = 'The Onion' + __author__ = 'Darko Miletic' + description = "America's finest news source" + oldest_article = 2 + max_articles_per_feed = 100 + publisher = u'Onion, Inc.' + category = u'humor, news, USA' + language = _('English') + no_stylesheets = True + use_embedded_content = False + encoding = 'utf-8' + remove_javascript = True + html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"' + + html2lrf_options = [ + '--comment' , description + , '--category' , category + , '--publisher' , publisher + ] + + keep_only_tags = [dict(name='div', attrs={'id':'main'})] + + remove_tags = [ + dict(name=['object','link','iframe','base']) + ,dict(name='div', attrs={'class':['toolbar_side','graphical_feature','toolbar_bottom']}) + ,dict(name='div', attrs={'id':['recent_slider','sidebar','pagination','related_media']}) + ] + + + feeds = [ + (u'Daily' , u'http://feeds.theonion.com/theonion/daily' ) + ,(u'Sports' , u'http://feeds.theonion.com/theonion/sports' ) + ]