home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_3753 < prev    next >
Encoding:
Text File  |  2009-10-14  |  1.8 KB  |  52 lines

  1. __license__   = 'GPL v3'
  2. __copyright__ = '2008-2009, Kovid Goyal <kovid at kovidgoyal.net>, Darko Miletic <darko at gmail.com>'
  3. '''
  4. Profile to download FAZ.net
  5. '''
  6.  
  7. from calibre.web.feeds.news import BasicNewsRecipe
  8.  
  9. class FazNet(BasicNewsRecipe): 
  10.     title                 = 'FAZ NET'
  11.     __author__            = 'Kovid Goyal, Darko Miletic'
  12.     description           = 'Frankfurter Allgemeine Zeitung'
  13.     publisher             = 'FAZ Electronic Media GmbH'
  14.     category              = 'news, politics, Germany'
  15.     use_embedded_content  = False
  16.     language = 'de'
  17.  
  18.     max_articles_per_feed = 30 
  19.     no_stylesheets        = True
  20.     encoding              = 'utf-8'
  21.     remove_javascript     = True
  22.  
  23.     html2lrf_options = [
  24.                           '--comment', description
  25.                         , '--category', category
  26.                         , '--publisher', publisher
  27.                         ]
  28.     
  29.     html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"' 
  30.     
  31.     keep_only_tags = [dict(name='div', attrs={'class':'Article'})]
  32.  
  33.     remove_tags = [
  34.                      dict(name=['object','link','embed','base'])
  35.                     ,dict(name='div', attrs={'class':['LinkBoxModulSmall','ModulVerlagsInfo']})
  36.                   ]
  37.     
  38.  
  39.     feeds = [ ('FAZ.NET', 'http://www.faz.net/s/Rub/Tpl~Epartner~SRss_.xml') ] 
  40.  
  41.     def print_version(self, url):
  42.         article, sep, rest = url.partition('?')    
  43.         return article.replace('.html', '~Afor~Eprint.html') 
  44.  
  45.     def preprocess_html(self, soup):
  46.         mtag = '<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>'
  47.         soup.head.insert(0,mtag)        
  48.         del soup.body['onload']
  49.         for item in soup.findAll(style=True):
  50.             del item['style']
  51.         return soup
  52.