diff --git a/src/calibre/gui2/images/news/seattle_times.png b/src/calibre/gui2/images/news/seattle_times.png new file mode 100644 index 0000000000..b885684992 Binary files /dev/null and b/src/calibre/gui2/images/news/seattle_times.png differ diff --git a/src/calibre/web/feeds/recipes/__init__.py b/src/calibre/web/feeds/recipes/__init__.py index 9e2ef1969d..405fd265a7 100644 --- a/src/calibre/web/feeds/recipes/__init__.py +++ b/src/calibre/web/feeds/recipes/__init__.py @@ -40,6 +40,7 @@ recipe_modules = ['recipe_' + r for r in ( 'krstarica', 'krstarica_en', 'tanjug', 'laprensa_ni', 'azstarnet', 'corriere_della_sera_it', 'corriere_della_sera_en', 'msdnmag_en', 'moneynews', 'der_standard', 'diepresse', 'nzz_ger', 'hna', + 'seattle_times', )] import re, imp, inspect, time, os diff --git a/src/calibre/web/feeds/recipes/recipe_seattle_times.py b/src/calibre/web/feeds/recipes/recipe_seattle_times.py new file mode 100644 index 0000000000..695a82b5b4 --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_seattle_times.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2009, Darko Miletic ' +''' +seattletimes.nwsource.com +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class SeattleTimes(BasicNewsRecipe): + title = 'The Seattle Times' + __author__ = 'Darko Miletic' + description = 'News from Seattle and USA' + publisher = 'The Seattle Times' + category = 'news, politics, USA' + oldest_article = 2 + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + encoding = 'cp1252' + language = _('English') + + html2lrf_options = [ + '--comment' , description + , '--category' , category + , '--publisher', publisher + ] + + html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"' + + feeds = [(u'Articles', u'http://seattletimes.nwsource.com/rss/seattletimes.xml')] + + remove_tags = [ + dict(name=['object','link','script']) + ,dict(name='p', attrs={'class':'permission'}) + ] + + def print_version(self, url): + start_url, sep, rest_url = url.rpartition('_') + rurl, rsep, article_id = start_url.rpartition('/') + return u'http://seattletimes.nwsource.com/cgi-bin/PrintStory.pl?document_id=' + article_id + + def preprocess_html(self, soup): + mtag = '' + soup.head.insert(0,mtag) + for item in soup.findAll(style=True): + del item['style'] + return soup +