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

  1. #!/usr/bin/env  python
  2.  
  3. __license__   = 'GPL v3'
  4. __copyright__ = '2008-2011, Lionel Bergeret <lbergeret at gmail.com>'
  5. '''
  6. cinebel.be
  7. '''
  8.  
  9. from calibre.web.feeds.news import BasicNewsRecipe
  10.  
  11. class Cinebel(BasicNewsRecipe):
  12.     title                 = u'Cinebel'
  13.     __author__            = u'Lionel Bergeret'
  14.     description           = u'Cinema news from Belgium in French'
  15.     publisher             = u'cinebel.be'
  16.     category              = 'news, cinema, movie, Belgium'
  17.     oldest_article        = 15
  18.     language              = 'fr'
  19.  
  20.     max_articles_per_feed = 20
  21.     no_stylesheets        = True
  22.     use_embedded_content  = False
  23.     timefmt               = ' [%d %b %Y]'
  24.     filterDuplicates      = True
  25.  
  26.     keep_only_tags = [
  27.      dict(name = 'span', attrs = {'class': 'movieMainTitle'})
  28.     ,dict(name = 'div', attrs = {'id': 'filmPoster'})
  29.         ,dict(name = 'div', attrs = {'id': 'filmDefinition'})
  30.         ,dict(name = 'div', attrs = {'id': 'synopsis'})
  31.     ]
  32.  
  33.     feeds = [
  34.          (u'Les sorties de la semaine' , u'http://www.cinebel.be/Servlets/RssServlet?languageCode=fr&rssType=0' )
  35.         ,(u'Top 10'                    , u'http://www.cinebel.be/Servlets/RssServlet?languageCode=fr&rssType=2' )
  36.     ]
  37.  
  38.     def preprocess_html(self, soup):
  39.         for alink in soup.findAll('a'):
  40.             if alink.has_key('href'):
  41.                tstr = "Site officiel: " + alink['href']
  42.                alink.replaceWith(tstr)
  43.         return soup
  44.  
  45.     def get_cover_url(self):
  46.         cover_url = 'http://www.cinebel.be/portal/resources/common/logo_index.gif'
  47.         return cover_url
  48.