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.recipe < prev    next >
Text File  |  2011-09-09  |  2KB  |  47 lines

  1. # -*- coding: utf-8 -*-
  2.  
  3. from calibre.web.feeds.news import BasicNewsRecipe
  4.  
  5. class TelepolisNews(BasicNewsRecipe):
  6.     title          = u'Telepolis (News+Artikel)'
  7.     __author__ = 'syntaxis'
  8.     publisher = 'Heise Zeitschriften Verlag GmbH & Co KG'
  9.     description = 'News from Telepolis'
  10.     category = 'news'
  11.     oldest_article = 7
  12.     max_articles_per_feed = 100
  13.     recursion = 0
  14.     no_stylesheets = True
  15.     encoding = "utf-8"
  16.     language = 'de'
  17.  
  18.  
  19.     remove_empty_feeds = True
  20.  
  21.  
  22.  
  23.     keep_only_tags = [dict(name = 'div',attrs={'class':'head'}),dict(name = 'div',attrs={'class':'leftbox'}),dict(name='td',attrs={'class':'strict'})]
  24.     remove_tags = [ dict(name='td',attrs={'class':'blogbottom'}),
  25.             dict(name='div',attrs={'class':'forum'}), dict(name='div',attrs={'class':'social'}),dict(name='div',attrs={'class':'blog-letter p-news'}),
  26.             dict(name='div',attrs={'class':'blog-sub'}),dict(name='div',attrs={'class':'version-div'}),dict(name='div',attrs={'id':'breadcrumb'})
  27.             ,dict(attrs={'class':'tp-url'}),dict(attrs={'class':'blog-name entry_'}) ]
  28.  
  29.     remove_tags_after  = [dict(name='span', attrs={'class':['breadcrumb']})]
  30.  
  31.  
  32.     feeds          = [(u'News', u'http://www.heise.de/tp/news-atom.xml')]
  33.  
  34.     html2lrf_options = [
  35.         '--comment'  , description
  36.         , '--category' , category
  37.         , '--publisher', publisher
  38.     ]
  39.  
  40.     html2epub_options  = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"'
  41.  
  42.  
  43.     def preprocess_html(self, soup):
  44.         mtag = '<meta http-equiv="Content-Type" content="text/html; charset=' + self.encoding + '">'
  45.         soup.head.insert(0,mtag)
  46.         return soup
  47.