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

  1.  
  2. __license__   = 'GPL v3'
  3. __copyright__ = '2011, Darko Miletic <darko.miletic at gmail.com>'
  4. '''
  5. www.clubdelebook.com
  6. '''
  7.  
  8. from calibre.web.feeds.news import BasicNewsRecipe
  9.  
  10. class ElClubDelEbook(BasicNewsRecipe):
  11.     title                 = 'El club del ebook'
  12.     __author__            = 'Darko Miletic'
  13.     description           = 'El Club del eBook, es la primera fuente de informacion sobre ebooks de Argentina. Aca vas a encontrar noticias, tips, tutoriales, recursos y opiniones sobre el mundo de los libros electronicos.'
  14.     tags                  = 'ebook, libro electronico, e-book, ebooks, libros electronicos, e-books'
  15.     oldest_article        = 7
  16.     max_articles_per_feed = 100
  17.     language              = 'es_AR'
  18.     encoding              = 'utf-8'
  19.     no_stylesheets        = True
  20.     use_embedded_content  = True
  21.     publication_type      = 'blog'
  22.     masthead_url          = 'http://dl.dropbox.com/u/2845131/elclubdelebook.png'
  23.     extra_css             = """
  24.                                 body{font-family: Arial,Helvetica,sans-serif}
  25.                                 img{ margin-bottom: 0.8em;
  26.                                      border: 1px solid #333333;
  27.                                      padding: 4px; display: block
  28.                                    }
  29.                             """
  30.  
  31.     conversion_options = {
  32.                           'comment'  : description
  33.                         , 'tags'     : tags
  34.                         , 'publisher': title
  35.                         , 'language' : language
  36.                         }
  37.  
  38.     remove_tags       = [dict(attrs={'id':'crp_related'})]
  39.     remove_tags_after = dict(attrs={'id':'crp_related'})
  40.  
  41.     feeds = [(u'Articulos', u'http://feeds.feedburner.com/ElClubDelEbook')]
  42.  
  43.     def preprocess_html(self, soup):
  44.         for item in soup.findAll(style=True):
  45.             del item['style']
  46.         for item in soup.findAll('a'):
  47.             limg = item.find('img')
  48.             if item.string is not None:
  49.                str = item.string
  50.                item.replaceWith(str)
  51.             else:
  52.                if limg:
  53.                   item.name = 'div'
  54.                   item.attrs = []
  55.                else:
  56.                    str = self.tag_to_string(item)
  57.                    item.replaceWith(str)
  58.         for item in soup.findAll('img'):
  59.             if not item.has_key('alt'):
  60.                item['alt'] = 'image'
  61.         return soup
  62.