home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_3622 < prev    next >
Encoding:
Text File  |  2010-03-27  |  1.9 KB  |  54 lines

  1.  
  2. __license__   = 'GPL v3'
  3. __copyright__ = '2008-2010, Darko Miletic <darko.miletic at gmail.com>'
  4. '''
  5. b92.net
  6. '''
  7. import re
  8. from calibre.web.feeds.news import BasicNewsRecipe
  9.  
  10. class B92(BasicNewsRecipe):
  11.     title                 = 'B92'
  12.     __author__            = 'Darko Miletic'
  13.     description           = 'B92 info, najnovije vesti iz Srbije, regiona i sveta'    
  14.     publisher             = 'B92'
  15.     category              = 'news, politics, Serbia'
  16.     oldest_article        = 2
  17.     max_articles_per_feed = 100
  18.     no_stylesheets        = True
  19.     use_embedded_content  = False
  20.     encoding              = 'cp1250'
  21.     language              = 'sr'
  22.     publication_type      = 'newsportal'
  23.     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} '
  24.     
  25.     conversion_options = {
  26.                           'comment'          : description
  27.                         , 'tags'             : category
  28.                         , 'publisher'        : publisher
  29.                         , 'language'         : language
  30.                         , 'linearize_tables' : True
  31.                         }
  32.     
  33.     preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')]
  34.     
  35.     keep_only_tags     = [dict(name='table', attrs={'class':'maindocument'})]
  36.  
  37.     remove_tags = [
  38.                      dict(name='ul', attrs={'class':'comment-nav'})
  39.                     ,dict(name=['embed','link','base']            )
  40.                     ,dict(name='div', attrs={'class':'udokum'}    )
  41.                   ]
  42.  
  43.     feeds          = [
  44.                         (u'Vesti', u'http://www.b92.net/info/rss/vesti.xml')
  45.                        ,(u'Biz'  , u'http://www.b92.net/info/rss/biz.xml'  )
  46.                      ]
  47.  
  48.     def print_version(self, url):
  49.         return url + '&version=print'
  50.  
  51.     def preprocess_html(self, soup):
  52.         return self.adeify_images(soup)
  53.  
  54.