home *** CD-ROM | disk | FTP | other *** search
/ Chip 2011 November / CHIP_2011_11.iso / Programy / Narzedzia / Calibre / calibre-0.8.18.msi / file_280 / telepolis_artikel.recipe < prev    next >
Encoding:
Text File  |  2011-09-09  |  1.4 KB  |  45 lines

  1. # -*- coding: utf-8 -*-
  2.  
  3. __license__   = 'GPL v3'
  4. __copyright__ = '2009, Gerhard Aigner <gerhard.aigner at gmail.com>'
  5.  
  6. ''' http://www.derstandard.at - Austrian Newspaper '''
  7. import re
  8. from calibre.web.feeds.news import BasicNewsRecipe
  9.  
  10. class TelepolisArtikel(BasicNewsRecipe):
  11.     title          = u'Telepolis (Artikel)'
  12.     __author__ = 'Gerhard Aigner'
  13.     publisher = 'Heise Zeitschriften Verlag GmbH & Co KG'
  14.     category = 'news'
  15.     description = 'Telepolis Artikel'
  16.     language = 'de_AT'
  17.     oldest_article = 7
  18.     max_articles_per_feed = 100
  19.     recursion = 0
  20.     no_stylesheets = True
  21.  
  22.     use_embedded_content = False
  23.     remove_empty_feeds = True
  24.  
  25.     remove_tags_before = dict(name='h1')
  26.     remove_tags = [dict(name='img')]
  27.  
  28.     feeds          = [(u'Artikel', u'http://www.heise.de/tp/rss/news-a.rdf')]
  29.  
  30.     preprocess_regexps = [(re.compile(r'<a[^>]*>', re.DOTALL|re.IGNORECASE), lambda match: ''),
  31.         (re.compile(r'</a>', re.DOTALL|re.IGNORECASE), lambda match: ''),]
  32.  
  33.     html2lrf_options = [
  34.         '--comment'  , description
  35.         , '--category' , category
  36.         , '--publisher', publisher]
  37.  
  38.     html2epub_options  = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"'
  39.  
  40.     def print_version(self, url):
  41.         p = re.compile(r'\d{5}', re.DOTALL|re.IGNORECASE)
  42.         m = p.search(url)
  43.         return "http://www.heise.de/bin/tp/issue/r4/dl-artikel2.cgi?artikelnr="+ m.group() +"&mode=print"
  44.  
  45.