From 3c402a26b00bbadd847ac697c6c78dcb5ea1536f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 7 Feb 2009 01:33:39 -0800 Subject: [PATCH] New recipe for The Exiled by Darko Miletic --- src/calibre/web/feeds/recipes/__init__.py | 2 +- .../web/feeds/recipes/recipe_exiled.py | 51 +++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 src/calibre/web/feeds/recipes/recipe_exiled.py diff --git a/src/calibre/web/feeds/recipes/__init__.py b/src/calibre/web/feeds/recipes/__init__.py index 14cbbfb634..0a05d9b270 100644 --- a/src/calibre/web/feeds/recipes/__init__.py +++ b/src/calibre/web/feeds/recipes/__init__.py @@ -26,7 +26,7 @@ recipe_modules = ['recipe_' + r for r in ( 'laprensa', 'amspec', 'freakonomics', 'criticadigital', 'elcronista', 'shacknews', 'teleread', 'granma', 'juventudrebelde', 'juventudrebelde_english', 'la_tercera', 'el_mercurio_chile', 'la_cuarta', 'lanacion_chile', 'la_segunda', - 'jb_online', 'estadao', 'o_globo', 'vijesti', 'elmundo', 'the_oz', + 'jb_online', 'estadao', 'o_globo', 'vijesti', 'elmundo', 'the_oz', 'exiled', )] import re, imp, inspect, time, os diff --git a/src/calibre/web/feeds/recipes/recipe_exiled.py b/src/calibre/web/feeds/recipes/recipe_exiled.py new file mode 100644 index 0000000000..e70e047e0d --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_exiled.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2009, Darko Miletic ' +''' +exiledonline.com +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class Exiled(BasicNewsRecipe): + title = 'Exiled Online' + __author__ = 'Darko Miletic' + description = "Mankind's only alternative since 1997 - Formerly known as The eXile" + publisher = 'Exiled Online' + language = _('English') + category = 'news, politics, international' + oldest_article = 15 + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + encoding = 'utf8' + remove_javascript = True + cover_url = 'http://exiledonline.com/wp-content/themes/exiledonline_theme/images/header-sm.gif' + + html2lrf_options = [ + '--comment' , description + , '--category' , category + , '--publisher' , publisher + ] + + html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"' + + keep_only_tags = [dict(name='div', attrs={'id':'main'})] + + remove_tags = [ + dict(name=['object','link']) + ,dict(name='div', attrs={'class':'info'}) + ,dict(name='div', attrs={'id':['comments','navig']}) + ] + + + feeds = [(u'Articles', u'http://exiledonline.com/feed/' )] + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + mtag = '\n\n\n' + soup.head.insert(0,mtag) + return soup +