From 27d52c02eb32b5268aabc1b9d6fc51b9d6af2580 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 21 Nov 2010 19:18:33 -0700 Subject: [PATCH] Improved telepolis --- resources/recipes/telepolis.recipe | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/resources/recipes/telepolis.recipe b/resources/recipes/telepolis.recipe index 1009dca275..4ca57f8275 100644 --- a/resources/recipes/telepolis.recipe +++ b/resources/recipes/telepolis.recipe @@ -3,12 +3,12 @@ __license__ = 'GPL v3' __copyright__ = '2009, Gerhard Aigner ' -''' http://www.derstandard.at - Austrian Newspaper ''' + import re from calibre.web.feeds.news import BasicNewsRecipe class TelepolisNews(BasicNewsRecipe): - title = u'Telepolis (News)' + title = u'Telepolis (News+Artikel)' __author__ = 'Gerhard Aigner' publisher = 'Heise Zeitschriften Verlag GmbH & Co KG' description = 'News from telepolis' @@ -20,16 +20,16 @@ class TelepolisNews(BasicNewsRecipe): encoding = "utf-8" language = 'de_AT' - use_embedded_content = False + use_embedded_content =False remove_empty_feeds = True preprocess_regexps = [(re.compile(r']*>', re.DOTALL|re.IGNORECASE), lambda match: ''), (re.compile(r'', re.DOTALL|re.IGNORECASE), lambda match: ''),] - keep_only_tags = [dict(name = 'table',attrs={'class':'blogtable'})] - remove_tags = [dict(name='img'), dict(name='td',attrs={'class':'blogbottom'})] + keep_only_tags = [dict(name = 'td',attrs={'class':'bloghead'}),dict(name = 'td',attrs={'class':'blogfliess'})] + remove_tags = [dict(name='img'), dict(name='td',attrs={'class':'blogbottom'}), dict(name='td',attrs={'class':'forum'})] - feeds = [(u'News', u'http://www.heise.de/tp/news.rdf')] + feeds = [(u'News', u'http://www.heise.de/tp/news-atom.xml')] html2lrf_options = [ '--comment' , description @@ -41,7 +41,7 @@ class TelepolisNews(BasicNewsRecipe): def get_article_url(self, article): '''if the linked article is of kind artikel don't take it''' - if (article.link.count('artikel') > 0) : + if (article.link.count('artikel') > 1) : return None return article.link @@ -49,3 +49,5 @@ class TelepolisNews(BasicNewsRecipe): mtag = '' soup.head.insert(0,mtag) return soup + +