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

  1.  
  2. __license__   = 'GPL v3'
  3. __copyright__ = '2009-2010, Darko Miletic <darko.miletic at gmail.com>'
  4. '''
  5. miamiherald.com
  6. '''
  7.  
  8. from calibre.web.feeds.news import BasicNewsRecipe
  9.  
  10. class TheMiamiHerald(BasicNewsRecipe):
  11.     title                 = 'The Miami Herald'
  12.     __author__            = 'Darko Miletic and Sujata Raman'
  13.     description           = "Miami-Dade and Broward's source for the latest breaking local news on sports, weather, business, jobs, real estate, shopping, health, travel, entertainment, & more."
  14.     oldest_article        = 1
  15.     max_articles_per_feed = 100
  16.     publisher             = u'The Miami Herald'
  17.     category              = u'miami herald, weather, dolphins, news, miami news, local news, miamiherald, miami newspaper, miamiherald.com, miami, the miami herald, broward, miami-dade'
  18.     language              = 'en'
  19.     no_stylesheets        = True
  20.     use_embedded_content  = False
  21.     encoding              = 'cp1252'
  22.     remove_javascript     = True
  23.     extra_css = '''
  24.                 h1{font-family:Arial,Helvetica,sans-serif; font-size:large; color:#1A272F; }
  25.                 .subheadline{font-family:Arial,Helvetica,sans-serif; font-size:30%; color: #666666;}
  26.                 #storyBodyContent{font-family:Arial,Helvetica,sans-serif; font-size:xx-small; }
  27.                 .byline{font-family:Arial,Helvetica,sans-serif; font-size:30%; color:#58595B; }
  28.                 .credit_line{font-family:Arial,Helvetica,sans-serif; font-size:30%; color:#58595B; }
  29.                 .storyPublishDate{font-family:Arial,Helvetica,sans-serif; font-size:30%; color:#666666; }
  30.                 .shirttail{font-family:Arial,Helvetica,sans-serif; font-size:30%; color:#666666;font-style:italic }
  31.                 .imageCaption{font-family:Arial,Helvetica,sans-serif; font-size:30%; color:#666666; }
  32.                 '''
  33.  
  34.     conversion_options = {
  35.                           'comment'   : description
  36.                         , 'tags'      : category
  37.                         , 'publisher' : publisher
  38.                         , 'language'  : language
  39.                         }
  40.                 
  41.     keep_only_tags = [dict(name='div', attrs={'id':'wide'}),]
  42.  
  43.     remove_tags = [dict(name=['object','link','embed','iframe','meta'])]
  44.  
  45.  
  46.     feeds = [
  47.              (u'Breaking News'  , u'http://www.miamiherald.com/news/breaking-news/index.xml' )
  48.              ,(u'Miami-Dade' , u'http://www.miamiherald.com/news/miami-dade/index.xml' )
  49.              ,(u'Broward' , u'http://www.miamiherald.com/news/broward/index.xml' )
  50.              ,(u'Florida Keys' , u'http://www.miamiherald.com/news/florida-keys/index.xml' )
  51.              ,(u'Florida' , u'http://www.miamiherald.com/news/florida/index.xml' )
  52.              ,(u'Nation' , u'http://www.miamiherald.com/news/nation/index.xml' )
  53.              ,(u'World' , u'http://www.miamiherald.com/news/world/index.xml' )
  54.              ,(u'Americas' , u'http://www.miamiherald.com/news/americas/index.xml' )
  55.              ,(u'Cuba' , u'http://www.miamiherald.com/news/americas/cuba/index.xml' )
  56.              ,(u'Haiti' , u'http://www.miamiherald.com/news/americas/haiti/index.xml' )
  57.              ,(u'Politics' , u'http://www.miamiherald.com/news/politics/index.xml' )
  58.              ,(u'Education' , u'http://www.miamiherald.com/news/education/index.xml' )
  59.              ,(u'Environment' , u'http://www.miamiherald.com/news/environment/index.xml' )
  60.             ]
  61.  
  62.     def print_version(self, url):
  63.         art, sep, rest = url.rpartition('/')
  64.         art2, sep2, rest2 = art.rpartition('/')
  65.         return art2 + '/v-print/' + rest2 + '/' + rest
  66.