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

  1.  
  2. __license__   = 'GPL v3'
  3. __copyright__ = '2009-2011, Darko Miletic <darko.miletic at gmail.com>'
  4.  
  5. '''
  6. vijesti.me
  7. '''
  8.  
  9. import re
  10. from calibre.web.feeds.news import BasicNewsRecipe
  11.  
  12. class Vijesti(BasicNewsRecipe):
  13.     title                 = 'Vijesti'
  14.     __author__            = 'Darko Miletic'
  15.     description           = 'News from Montenegro'
  16.     publisher             = 'Daily Press Vijesti'
  17.     category              = 'news, politics, Montenegro'
  18.     oldest_article        = 2
  19.     max_articles_per_feed = 150
  20.     no_stylesheets        = True
  21.     encoding              = 'utf8'
  22.     use_embedded_content  = False
  23.     language              = 'sr'
  24.     publication_type      = 'newspaper'
  25.     extra_css             = """
  26.                                 @font-face {font-family: "serif1";src:url(res:///opt/sony/ebook/FONT/tt0011m_.ttf)} 
  27.                                 @font-face {font-family: "sans1";src:url(res:///opt/sony/ebook/FONT/tt0003m_.ttf)} 
  28.                                 body{font-family: Georgia,"Times New Roman",Times,serif1,serif} 
  29.                                 .articledescription,.article,.chapter{font-family: sans1, sans-serif} 
  30.                             """
  31.  
  32.     conversion_options = {
  33.                           'comment'          : description
  34.                         , 'tags'             : category
  35.                         , 'publisher'        : publisher
  36.                         , 'language'         : language
  37.                         }
  38.  
  39.     preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')]
  40.  
  41.     keep_only_tags = [dict(name='div', attrs={'id':['article_intro_text','article_text']})]
  42.  
  43.     remove_tags = [dict(name=['object','link','embed','form'])]
  44.  
  45.     feeds = [(u'Sve vijesti', u'http://www.vijesti.me/rss/' )]
  46.  
  47.     def preprocess_html(self, soup):
  48.         return self.adeify_images(soup)
  49.  
  50.