diff --git a/src/calibre/gui2/images/news/theonion.png b/src/calibre/gui2/images/news/theonion.png new file mode 100644 index 0000000000..d29c69562d Binary files /dev/null and b/src/calibre/gui2/images/news/theonion.png differ 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' ) + ]