home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_4123 < prev    next >
Encoding:
Text File  |  2010-07-25  |  1.6 KB  |  46 lines

  1.  
  2. __license__   = 'GPL v3'
  3. __copyright__ = '2009-2010, 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              = 'cp1250'
  22.     use_embedded_content  = False
  23.     language              = 'sr'
  24.     publication_type      = 'newspaper'
  25.     masthead_url          = 'http://www.vijesti.me/img/logo.gif'    
  26.     extra_css             = '@font-face {font-family: "serif1";src:url(res:///opt/sony/ebook/FONT/tt0011m_.ttf)} @font-face {font-family: "sans1";src:url(res:///opt/sony/ebook/FONT/tt0003m_.ttf)} body{font-family: serif1, serif} .article_description{font-family: sans1, sans-serif}'
  27.  
  28.     conversion_options = {
  29.                           'comment'          : description
  30.                         , 'tags'             : category
  31.                         , 'publisher'        : publisher
  32.                         , 'language'         : language
  33.                         }
  34.  
  35.     preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')]
  36.  
  37.     keep_only_tags = [dict(name='div', attrs={'id':'mainnews'})]
  38.  
  39.     remove_tags = [dict(name=['object','link','embed','form'])]
  40.  
  41.     feeds = [(u'Sve vijesti', u'http://www.vijesti.me/rss.php' )]
  42.  
  43.     def preprocess_html(self, soup):
  44.         return self.adeify_images(soup)
  45.  
  46.