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

  1. from calibre.web.feeds.news import BasicNewsRecipe
  2.  
  3. class CMJornal_pt(BasicNewsRecipe):
  4.     title                 = 'Correio da Manha - Portugal'
  5.     __author__            = 'jmst'
  6.     description           = 'As noticias de Portugal e do Mundo'
  7.     publisher             = 'Cofina Media'
  8.     category              = ''
  9.     oldest_article        = 1
  10.     no_stylesheets        = True
  11.     encoding              = 'utf-8'
  12.     use_embedded_content  = False
  13.     language              = 'pt'
  14.     extra_css             = ' .publish{font-style: italic; line-height: 1.2em; border-bottom: 1px dotted; padding: 5px 0} .entity{line-height: 1.2em} .overview{line-height:1.2em} '
  15.  
  16.     conversion_options = {
  17.                           'comment'   : description
  18.                         , 'tags'      : category
  19.                         , 'publisher' : publisher
  20.                         , 'language'  : language
  21.                         }
  22.  
  23.     keep_only_tags = [
  24.                         dict(name=['h2','h1'])
  25.                       , dict(name='div', attrs={'class': ['news']})
  26.                      ]
  27.  
  28.     remove_tags = [
  29.                     dict(name=['object','embed','iframe'])
  30.                    ,dict(name='a',attrs={'href':['#']})
  31.                   ]
  32.  
  33.     feeds = [
  34.               (u'Actualidade' , u'http://www.cmjornal.xl.pt/rss/rss.aspx?channelID=00000009-0000-0000-0000-000000000009' )
  35.              ,(u'Portugal'    , u'http://www.cmjornal.xl.pt/rss/rss.aspx?channelID=00000010-0000-0000-0000-000000000010'    )
  36.              ,(u'Economia' , u'http://www.cmjornal.xl.pt/rss/rss.aspx?channelID=00000011-0000-0000-0000-000000000011' )
  37.              ,(u'Mundo' , u'http://www.cmjornal.xl.pt/rss/rss.aspx?channelID=00000091-0000-0000-0000-000000000091' )
  38.              ,(u'Desporto' , u'http://www.cmjornal.xl.pt/rss/rss.aspx?channelID=00000012-0000-0000-0000-000000000012'  )
  39.              ,(u'TV & Media', u'http://www.cmjornal.xl.pt/rss/rss.aspx?channelID=00000092-0000-0000-0000-000000000092')
  40.             ]
  41.  
  42.     def print_version(self, url):
  43.         return url.replace('noticia.aspx', 'Imprimir.aspx')
  44.  
  45.