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

  1. #!/usr/bin/env  python
  2.  
  3. __license__   = 'GPL v3'
  4. __copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
  5.  
  6. '''
  7. theonion.com
  8. '''
  9.  
  10. from calibre.web.feeds.news import BasicNewsRecipe
  11.  
  12. class TheOnion(BasicNewsRecipe):
  13.     title                 = 'The Onion'
  14.     __author__            = 'Darko Miletic'
  15.     description           = "America's finest news source"    
  16.     oldest_article        = 2    
  17.     max_articles_per_feed = 100
  18.     publisher             = u'Onion, Inc.'
  19.     category              = u'humor, news, USA'    
  20.     language = 'en'
  21.  
  22.     no_stylesheets        = True
  23.     use_embedded_content  = False
  24.     encoding              = 'utf-8'
  25.     remove_javascript     = True
  26.     html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"' 
  27.      
  28.     html2lrf_options = [
  29.                           '--comment'       , description
  30.                         , '--category'      , category
  31.                         , '--publisher'     , publisher
  32.                         ]
  33.  
  34.     keep_only_tags = [dict(name='div', attrs={'id':'main'})]
  35.     
  36.     remove_tags = [
  37.                      dict(name=['object','link','iframe','base'])
  38.                     ,dict(name='div', attrs={'class':['toolbar_side','graphical_feature','toolbar_bottom']})
  39.                     ,dict(name='div', attrs={'id':['recent_slider','sidebar','pagination','related_media']})
  40.                   ]
  41.  
  42.                             
  43.     feeds = [
  44.               (u'Daily'  , u'http://feeds.theonion.com/theonion/daily' )
  45.              ,(u'Sports' , u'http://feeds.theonion.com/theonion/sports' )
  46.             ]
  47.