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

  1.  
  2. __license__   = 'GPL v3'
  3. __copyright__ = '2009-2010, Darko Miletic <darko.miletic at gmail.com>'
  4.  
  5. '''
  6. 24sata.rs
  7. '''
  8.  
  9. import re
  10. from calibre.web.feeds.recipes import BasicNewsRecipe
  11.  
  12. class Ser24Sata(BasicNewsRecipe):
  13.     title                 = '24 Sata - Sr'
  14.     __author__            = 'Darko Miletic'
  15.     description           = '24 sata portal vesti iz Srbije'
  16.     publisher             = 'Ringier d.o.o.'
  17.     category              = 'news, politics, entertainment, Serbia'
  18.     oldest_article        = 2
  19.     max_articles_per_feed = 100
  20.     no_stylesheets        = True
  21.     encoding              = 'utf-8'
  22.     use_embedded_content  = False
  23.     language              = 'sr'
  24.     publication_type      = 'newspaper'    
  25.     extra_css             = '@font-face {font-family: "serif1";src:url(res:///opt/sony/ebook/FONT/tt0011m_.ttf)} body{font-family: serif1, serif} .article_description{font-family: serif1, serif}'
  26.  
  27.     conversion_options = {
  28.                           'comment'          : description
  29.                         , 'tags'             : category
  30.                         , 'publisher'        : publisher
  31.                         , 'language'         : language
  32.                         , 'linearize_tables' : True
  33.                         }
  34.  
  35.     preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')]
  36.  
  37.     feeds = [(u'Vesti Dana', u'http://www.24sata.rs/rss.php')]
  38.  
  39.     def preprocess_html(self, soup):
  40.         return self.adeify_images(soup)
  41.  
  42.     def print_version(self, url):
  43.         article    = url.partition('#')[0]
  44.         article_id = article.partition('id=')[2]
  45.         return 'http://www.24sata.rs/_print.php?id=' + article_id
  46.  
  47.