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

  1. __license__   = 'GPL v3'
  2. __copyright__ = '2008-2010, Darko Miletic <darko.miletic at gmail.com>'
  3. '''
  4. nspm.rs/nspm-in-english
  5. '''
  6.  
  7. from calibre.web.feeds.news import BasicNewsRecipe
  8.  
  9. class Nspm_int(BasicNewsRecipe):
  10.     title                 = 'NSPM in English'
  11.     __author__            = 'Darko Miletic'
  12.     description           = 'Magazine dedicated to political theory and sociological research'
  13.     publisher             = 'NSPM'
  14.     category              = 'news, politics, Serbia'
  15.     oldest_article        = 7
  16.     max_articles_per_feed = 100
  17.     no_stylesheets        = True
  18.     use_embedded_content  = False
  19.     encoding              = 'utf-8'
  20.     language              = 'en'
  21.     delay                 = 2
  22.     publication_type      = 'magazine'    
  23.     masthead_url          = 'http://www.nspm.rs/templates/jsn_epic_pro/images/logol.jpg'
  24.     extra_css             = """ 
  25.                                 body{font-family: "Times New Roman", serif} 
  26.                                 .article_description{font-family: Arial, sans-serif} 
  27.                                 img{margin-top:0.5em; margin-bottom: 0.7em} 
  28.                                 .author{color: #990000; font-weight: bold} 
  29.                                 .author,.createdate{font-size: 0.9em} """
  30.  
  31.     conversion_options = {
  32.                           'comment'          : description
  33.                         , 'tags'             : category
  34.                         , 'publisher'        : publisher
  35.                         , 'language'         : language
  36.                         , 'linearize_tables' : True
  37.                         }
  38.  
  39.     keep_only_tags = [dict(attrs={'id':'jsn-mainbody'})]
  40.     remove_tags        = [
  41.                            dict(name=['link','object','embed','script','meta','base','iframe'])
  42.                           ,dict(attrs={'class':'buttonheading'})
  43.                          ]
  44.     remove_tags_after = dict(attrs={'class':'article_separator'})
  45.     remove_attributes = ['width','height']
  46.  
  47.     feeds = [(u'Articles', u'http://www.nspm.rs/nspm-in-english/feed/rss.html')]
  48.  
  49.     def preprocess_html(self, soup):
  50.         for item in soup.body.findAll(style=True):
  51.             del item['style']
  52.         return self.adeify_images(soup)