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

  1. __license__   = 'GPL v3'
  2. __copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
  3. '''
  4. balkaninsight.com
  5. '''
  6.  
  7. import re
  8. from calibre.web.feeds.news import BasicNewsRecipe
  9.  
  10. class BalkanInsight(BasicNewsRecipe):
  11.     title                 = 'Balkan Insight'
  12.     __author__            = 'Darko Miletic'
  13.     description           = 'Get exclusive news and in depth information on business, politics, events and lifestyle in the Balkans. Free and exclusive premium content.'
  14.     publisher             = 'BalkanInsight.com'
  15.     category              = 'news, politics, Balcans'
  16.     oldest_article        = 2
  17.     max_articles_per_feed = 100
  18.     no_stylesheets        = False
  19.     use_embedded_content  = False
  20.     encoding              = 'utf-8'
  21.     masthead_url          = 'http://www.balkaninsight.com/templates/balkaninsight/images/aindex_02.jpg'
  22.     language              = 'en'
  23.     publication_type      = 'newsportal'
  24.     remove_empty_feeds    = True
  25.     extra_css             = """ @font-face {font-family: "serif1";src:url(res:///opt/sony/ebook/FONT/tt0011m_.ttf)}
  26.                                 @font-face {font-family: "sans1";src:url(res:///opt/sony/ebook/FONT/tt0003m_.ttf)}
  27.                                 .article_description,body{font-family: Arial,Verdana,Helvetica,sans1,sans-serif}
  28.                                 img{margin-bottom: 0.8em}
  29.                                 h1,h2,h3,h4{font-family: Times,Georgia,serif1,serif; color: #24569E}
  30.                                 .article-deck {color:#777777; font-size: small;}
  31.                                 .main_news_img{font-size: small} """
  32.  
  33.     conversion_options = {
  34.                           'comment'          : description
  35.                         , 'tags'             : category
  36.                         , 'publisher'        : publisher
  37.                         , 'language'         : language
  38.                         }
  39.  
  40.     preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')]
  41.  
  42.     keep_only_tags     = [dict(name='div', attrs={'id':'article'})]
  43.     remove_tags = [
  44.                     dict(name=['object','link','iframe'])
  45.                   ]
  46.  
  47.     feeds          = [
  48.                         (u'Albania'    , u'http://www.balkaninsight.com/?tpl=653&tpid=144' )
  49.                        ,(u'Bosnia'     , u'http://www.balkaninsight.com/?tpl=653&tpid=145' )
  50.                        ,(u'Bulgaria'   , u'http://www.balkaninsight.com/?tpl=653&tpid=146' )
  51.                        ,(u'Croatia'    , u'http://www.balkaninsight.com/?tpl=653&tpid=147' )
  52.                        ,(u'Kosovo'     , u'http://www.balkaninsight.com/?tpl=653&tpid=148' )
  53.                        ,(u'Macedonia'  , u'http://www.balkaninsight.com/?tpl=653&tpid=149' )
  54.                        ,(u'Montenegro' , u'http://www.balkaninsight.com/?tpl=653&tpid=150' )
  55.                        ,(u'Romania'    , u'http://www.balkaninsight.com/?tpl=653&tpid=151' )
  56.                        ,(u'Serbia'     , u'http://www.balkaninsight.com/?tpl=653&tpid=152' )
  57.                      ]
  58.  
  59.     def preprocess_html(self, soup):
  60.         for item in soup.findAll(style=True):
  61.             del item['style']
  62.         return self.adeify_images(soup)
  63.