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

  1.  
  2. __license__   = 'GPL v3'
  3. __copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
  4. '''
  5. www.ionline.pt
  6. '''
  7.  
  8. from calibre.web.feeds.news import BasicNewsRecipe
  9.  
  10. class IOnline_pt(BasicNewsRecipe):
  11.     title                 = 'ionline - Portugal'
  12.     __author__            = 'Darko Miletic'
  13.     description           = 'News from Portugal'
  14.     publisher             = 'ionline.pt'
  15.     category              = 'ionline, noticias, portugal, jornal, actualidade, benfica, bolsa, desporto, empresas, globo, europa, futebol, internacional, investir, lisboa, jogos, musica, videos, tempo, meteorologia, pais, politica, porto, sporting, fcporto, televisao, tv, opiniao, nacional, sociedade, crise, financeira, policia, crime, artes, cinema, cultura, madeleine, blog, ciencia, tecnologia, galerias, fotografia, fotos, famosos, emprego, imagens, teatro, news, mundial, governo, ps, psd, be, pcp, cds, pp, partidos'
  16.     oldest_article        = 2
  17.     max_articles_per_feed = 100
  18.     no_stylesheets        = True
  19.     encoding              = 'utf-8'
  20.     use_embedded_content  = False
  21.     language              = 'pt'
  22.     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} '
  23.  
  24.     conversion_options = {
  25.                           'comment'   : description
  26.                         , 'tags'      : category
  27.                         , 'publisher' : publisher
  28.                         , 'language'  : language
  29.                         }
  30.  
  31.     keep_only_tags = [
  32.                         dict(name=['h5','h1'])
  33.                       , dict(name='div', attrs={'class':['publish','overview','entity']})
  34.                      ]
  35.  
  36.     remove_tags = [
  37.                     dict(name=['object','embed','iframe'])
  38.                   ]
  39.  
  40.  
  41.     feeds = [
  42.               (u'Portugal' , u'http://www.ionline.pt/rss/portugal.xml' )
  43.              ,(u'Mundo'    , u'http://www.ionline.pt/rss/mundo.xml'    )
  44.              ,(u'Dinheiro' , u'http://www.ionline.pt/rss/dinheiro.xml' )
  45.              ,(u'Desporto' , u'http://www.ionline.pt/rss/desporto.xml' )
  46.              ,(u'Boa Vida' , u'http://www.ionline.pt/rss/boavida.xml'  )
  47.              ,(u'iReporter', u'http://www.ionline.pt/rss/ireporter.xml')
  48.              ,(u'iBloges'  , u'http://www.ionline.pt/rss/iblogues.xml' )
  49.              ,(u'Desporto' , u'http://www.ionline.pt/rss/desporto.xml' )
  50.             ]
  51.  
  52.     def print_version(self, url):
  53.         rest  = url.rpartition('/')[2]
  54.         lmain = rest.partition('-')[0]
  55.         lurl = u'http://www.ionline.pt/interior/index.php?p=news-print&idNota=' + lmain
  56.         return lurl
  57.  
  58.  
  59.