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

  1. #!/usr/bin/env  python
  2.  
  3. __license__   = 'GPL v3'
  4. __copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
  5. '''
  6. www.business-standard.com
  7. '''
  8.  
  9. from calibre.web.feeds.recipes import BasicNewsRecipe
  10.  
  11. class BusinessStandard(BasicNewsRecipe):
  12.     title                  = 'Business Standard'
  13.     __author__             = 'Darko Miletic'
  14.     description            = "India's most respected business daily"
  15.     oldest_article         = 7
  16.     max_articles_per_feed  = 100
  17.     no_stylesheets         = True
  18.     use_embedded_content   = False
  19.     encoding               = 'cp1252'
  20.     publisher              = 'Business Standard Limited'
  21.     category               = 'news, business, money, india, world'
  22.     language               = 'en_IN'
  23.  
  24.     conversion_options = {
  25.                              'comments'        : description
  26.                             ,'tags'            : category
  27.                             ,'language'        : language
  28.                             ,'publisher'       : publisher
  29.                             ,'linearize_tables': True
  30.                          }
  31.  
  32.     remove_attributes=['style']
  33.     remove_tags = [dict(name=['object','link','script','iframe'])]
  34.  
  35.     feeds = [
  36.                (u'News Now'            , u'http://feeds.business-standard.com/News-Now.xml'              )
  37.               ,(u'Banking & finance'   , u'http://feeds.business-standard.com/Banking-Finance-All.xml'   )
  38.               ,(u'Companies & Industry', u'http://feeds.business-standard.com/Companies-Industry-All.xml')
  39.               ,(u'Economy & Policy'    , u'http://feeds.business-standard.com/Economy-Policy-All.xml'    )
  40.               ,(u'Tech World'          , u'http://feeds.business-standard.com/Tech-World-All.xml'        )
  41.               ,(u'Life & Leisure'      , u'http://feeds.business-standard.com/Life-Leisure-All.xml'      )
  42.               ,(u'Markets & Investing' , u'http://feeds.business-standard.com/Markets-Investing-All.xml' )
  43.               ,(u'Management & Mktg'   , u'http://feeds.business-standard.com/Management-Mktg-All.xml'   )
  44.               ,(u'Automobiles'         , u'http://feeds.business-standard.com/Automobiles.xml'           )
  45.               ,(u'Aviation'            , u'http://feeds.business-standard.com/Aviation.xml'              )
  46.             ]
  47.  
  48.     def print_version(self, url):
  49.         autono  = url.rpartition('autono=')[2]
  50.         tp = 'on'
  51.         hk = url.rpartition('bKeyFlag=')[1]
  52.         if  hk == '':
  53.            tp = ''
  54.         return 'http://www.business-standard.com/india/printpage.php?autono=' + autono + '&tp=' + tp
  55.  
  56.     def get_article_url(self, article):
  57.         return article.get('guid',  None)
  58.