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

  1. __license__   = 'GPL v3'
  2. __copyright__ = '2009-2010, Darko Miletic <darko.miletic at gmail.com>'
  3. '''
  4. www.boston.com
  5. '''
  6.  
  7. from calibre.web.feeds.recipes import BasicNewsRecipe
  8.  
  9. class BusinessStandard(BasicNewsRecipe):
  10.     title                  = 'The Boston Globe'
  11.     __author__             = 'Darko Miletic'
  12.     description            = 'News from Boston'
  13.     oldest_article         = 2
  14.     max_articles_per_feed  = 100
  15.     no_stylesheets         = True
  16.     delay                  = 1
  17.     use_embedded_content   = False
  18.     encoding               = 'cp1252'
  19.     publisher              = 'Boston'
  20.     category               = 'news, boston, usa, world'
  21.     language               = 'en'
  22.     publication_type       = 'newspaper'
  23.     masthead_url           = 'http://cache.boston.com/images/globe/grslider/the_boston_globe.gif'
  24.     extra_css              = ' body{font-family: Georgia, serif} div#articleBodyTop{display:block} '
  25.  
  26.     conversion_options = {
  27.                              'comments'        : description
  28.                             ,'tags'            : category
  29.                             ,'language'        : language
  30.                             ,'publisher'       : publisher
  31.                          }
  32.  
  33.     keep_only_tags   = [dict(attrs={'id':['INDblogEntry','blogEntry','articleHeader','articleGraphs','galleryShell']})]
  34.     remove_tags      = [
  35.                           dict(name=['object','link','script','iframe'])
  36.                          ,dict(attrs={'id':['blogheadTools','bdc_emailWidget','tools','relatedContent']})
  37.                        ]
  38.  
  39.     feeds = [
  40.                (u'Top Stories'  , u'http://feeds.boston.com/boston/topstories'              )
  41.               ,(u'Patriots news', u'http://feeds.boston.com/boston/sports/football/patriots')
  42.               ,(u'National news', u'http://feeds.boston.com/boston/news/nation'             )
  43.               ,(u'World news'   , u'http://feeds.boston.com/boston/news/world'              )
  44.             ]
  45.  
  46.     def print_version(self, url):
  47.         return url + '?page=full'
  48.  
  49.     def get_article_url(self, article):
  50.         rawarticle = article.get('guid', None)
  51.         return rawarticle.rpartition('?')[0]
  52.  
  53.