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

  1. __license__   = 'GPL v3'
  2. __copyright__ = '2009-2010, Darko Miletic <darko.miletic at gmail.com>'
  3. '''
  4. cubadebate.cu
  5. '''
  6.  
  7. from calibre.web.feeds.news import BasicNewsRecipe
  8.  
  9. class CubaDebate(BasicNewsRecipe):
  10.     title                 = 'CubaDebate'
  11.     __author__            = 'Darko Miletic'
  12.     description           = 'Contra el Terorismo Mediatico'
  13.     oldest_article        = 15
  14.     language              = 'es_CU'
  15.     max_articles_per_feed = 100
  16.     no_stylesheets        = True
  17.     use_embedded_content  = False
  18.     publisher             = 'Cubadebate'
  19.     category              = 'news, politics, Cuba'
  20.     encoding              = 'utf-8'
  21.     masthead_url          = 'http://www.cubadebate.cu/wp-content/themes/cubadebate/images/logo.gif'
  22.     publication_type      = 'newsportal'
  23.     extra_css             = """
  24.                                #BlogTitle{font-size: xx-large; font-weight: bold}
  25.                                body{font-family: Verdana, Arial, Tahoma, sans-serif}
  26.                             """
  27.  
  28.     conversion_options = {
  29.                              'comments'    : description
  30.                             ,'tags'        : category
  31.                             ,'language'    : language
  32.                             ,'publisher'   : publisher
  33.                          }
  34.  
  35.     keep_only_tags = [dict(name='div', attrs={'id':'Outline'})]
  36.     remove_tags_after = dict(name='div',attrs={'id':'BlogContent'})
  37.     remove_tags = [
  38.                      dict(name=['link','base','embed','object','meta','iframe'])
  39.                     ,dict(attrs={'id':'addthis_container'})
  40.                   ]
  41.  
  42.     feeds          = [(u'Articulos', u'http://www.cubadebate.cu/feed/')]
  43.     remove_attributes=['width','height','lang']
  44.  
  45.     def print_version(self, url):
  46.         return url + 'print/'
  47.  
  48.     def preprocess_html(self, soup):
  49.         for item in soup.findAll(style=True):
  50.             del item['style']
  51.         for item in soup.findAll('img'):
  52.             if not item.has_key('alt'):
  53.                item['alt'] = 'image'
  54.         return soup
  55.