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

  1. __license__   = 'GPL v3'
  2. __copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
  3. '''
  4. emg.rs/vesti
  5. '''
  6.  
  7. import re
  8. from calibre.web.feeds.news import BasicNewsRecipe
  9.  
  10. class emportal_rs(BasicNewsRecipe):
  11.     title                 = 'Ekonom:east Vesti'
  12.     __author__            = 'Darko Miletic'
  13.     description           = 'Vasa dnevna doza poslovnih informacija iz Srbije, regiona i sveta. Vesti, Berze, Dogadaji, Casopisi.'
  14.     publisher             = 'Ekonom:east Media Group'
  15.     category              = 'Ekonom:east Media Group, Ekonomist, Budelar, Bankar, EMportal, Preduzeca, Moja Posla, EU praktikum, ekonomija, Srbija, Beograd, investicije, finansije, energetika, berza'
  16.     oldest_article        = 2
  17.     max_articles_per_feed = 200
  18.     no_stylesheets        = True
  19.     encoding              = 'utf8'
  20.     use_embedded_content  = False
  21.     language              = 'sr'
  22.     remove_empty_feeds    = True
  23.     masthead_url          = 'http://www.emg.rs/img/emportal-rss.png'
  24.     extra_css             = ' @font-face {font-family: "sans1";src:url(res:///opt/sony/ebook/FONT/tt0003m_.ttf)} body{font-family: Arial,Helvetica,sans1,sans-serif } .article_description{font-family: sans1, sans-serif} '
  25.  
  26.     conversion_options = {
  27.                           'comment'   : description
  28.                         , 'tags'      : category
  29.                         , 'publisher' : publisher
  30.                         , 'language'  : language
  31.                         }
  32.  
  33.     preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')]
  34.     remove_tags        = [dict(attrs={'class':['text-share']})]
  35.     keep_only_tags     = [dict(attrs={'class':'text'})]
  36.     remove_tags_after  = dict(attrs={'class':'text-share'})
  37.     remove_attributes  = ['width','height']
  38.  
  39.     feeds = [
  40.               (u'Srbija' , u'http://www.emg.rs/vesti/srbija/rss.xml')
  41.              ,(u'Region' , u'http://www.emg.rs/vesti/region/rss.xml')
  42.              ,(u'Svet'   , u'http://www.emg.rs/vesti/svet/rss.xml'  )
  43.             ]
  44.  
  45.     def print_version(self, url):
  46.         return url.replace('.html','.print.html')
  47.  
  48.     def preprocess_html(self, soup):
  49.         for item in soup.findAll(style=True):
  50.             del item['style']
  51.         return soup
  52.