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

  1. __license__   = 'GPL v3'
  2. __copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
  3. '''
  4. www.thewaythefutureblogs.com
  5. Frederik Pohl's Blog
  6. '''
  7.  
  8. from calibre.web.feeds.news import BasicNewsRecipe
  9.  
  10. class TheWayTheFutureBlogs(BasicNewsRecipe):
  11.     title                 = 'The Way the Future Blogs'
  12.     __author__            = 'Darko Miletic'
  13.     description           = "Frederik Pohl's blog"
  14.     publisher             = 'Frederik Pohl'
  15.     category              = 'news, SF, books'
  16.     oldest_article        = 30
  17.     max_articles_per_feed = 200
  18.     no_stylesheets        = True
  19.     encoding              = 'utf8'
  20.     use_embedded_content  = False
  21.     language              = 'en'
  22.     remove_empty_feeds    = True
  23.     extra_css             = ' body{font-family: Georgia,serif } '
  24.  
  25.     conversion_options = {
  26.                           'comment'   : description
  27.                         , 'tags'      : category
  28.                         , 'publisher' : publisher
  29.                         , 'language'  : language
  30.                         }
  31.     remove_tags   =[dict(name=['meta','object','embed','iframe','base','link'])]
  32.     keep_only_tags=[dict(attrs={'class':['post','commentlist']})]
  33.     remove_attributes=['width','height','lang','border']
  34.  
  35.     feeds = [(u'Posts', u'http://www.thewaythefutureblogs.com/feed/')]
  36.  
  37.     def preprocess_html(self, soup):
  38.         for item in soup.findAll(style=True):
  39.             del item['style']
  40.         return soup
  41.