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

  1. __license__   = 'GPL v3'
  2. __copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
  3. '''
  4. theeconomiccollapseblog.com
  5. '''
  6.  
  7. from calibre.web.feeds.news import BasicNewsRecipe
  8. class TheEconomicCollapse(BasicNewsRecipe):
  9.     title                 = 'The Economic Collapse'
  10.     __author__            = 'Darko Miletic'
  11.     description           = 'Are You Prepared For The Coming Economic Collapse And The Next Great Depression?'
  12.     publisher             = 'The Economic Collapse'
  13.     category              = 'news, politics, USA, economy'
  14.     oldest_article        = 2
  15.     max_articles_per_feed = 200
  16.     no_stylesheets        = True
  17.     encoding              = 'utf8'
  18.     use_embedded_content  = False
  19.     language              = 'en'
  20.     remove_empty_feeds    = True
  21.     extra_css             = """
  22.                                 body{font-family: Tahoma,Arial,sans-serif }
  23.                                 img{margin-bottom: 0.4em}
  24.                             """
  25.  
  26.     conversion_options = {
  27.                           'comment'   : description
  28.                         , 'tags'      : category
  29.                         , 'publisher' : publisher
  30.                         , 'language'  : language
  31.                         }
  32.  
  33.     remove_tags = [
  34.                      dict(attrs={'class':'sociable'})
  35.                     ,dict(name=['iframe','object','embed','meta','link','base'])
  36.                   ]
  37.     remove_attributes=['lang','onclick','width','height']
  38.     keep_only_tags=[dict(attrs={'class':['post-headline','post-bodycopy clearfix','']})]
  39.  
  40.     feeds = [(u'Posts', u'http://theeconomiccollapseblog.com/feed')]
  41.  
  42.     def preprocess_html(self, soup):
  43.         for item in soup.findAll(style=True):
  44.             del item['style']
  45.         return self.adeify_images(soup)
  46.  
  47.