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

  1. from calibre.web.feeds.news import BasicNewsRecipe
  2.  
  3. class AdvancedUserRecipe1282101454(BasicNewsRecipe):
  4.     title = 'Kansascity Star'
  5.     language = 'en'
  6.     __author__ = 'TonytheBookworm'
  7.     description = 'www.kansascity.com feed'
  8.     publisher = 'Tony Stegall'
  9.     category = 'news, politics, USA, kansascity'
  10.     oldest_article = 7
  11.     max_articles_per_feed = 100
  12.     no_stylesheets = True
  13.  
  14.     masthead_url = 'http://media.kansascity.com/images/site_logo_340x60.gif'
  15.     keep_only_tags    = [
  16.                          dict(attrs={'id':['storyTitle','sub_headline','byLine']})
  17.                         ,dict(name='div', attrs={'id':['storyDate-Links','storyBody']})
  18.  
  19.                         ]
  20.     feeds          = [
  21.                       ('Kansas News', 'http://www.kansascity.com/105/index.xml'),
  22.  
  23.                     ]
  24.  
  25.  
  26.  
  27.  
  28.     def print_version(self, url):
  29.         split1 = url.split("/")
  30.         #url1 = split1[0]
  31.         #url2 = split1[1]
  32.         url3 = split1[2]
  33.         url4 = split1[3]
  34.         url5 = split1[4]
  35.         url6 = split1[5]
  36.         url7 = split1[6]
  37.         url8 = split1[7]
  38.  
  39.  
  40.         #example of link to convert
  41.         #Original link: http://www.kansascity.com/2010/09/04/2199362/lees-summit-school-appears-to.html
  42.         #print version: http://www.kansascity.com/2010/09/04/v-print/2199362/lees-summit-school-appears-to.html
  43.  
  44.         print_url = 'http://' + url3 + '/' + url4 + '/' + url5 + '/' + url6 + '/v-print/' + url7 + '/' + url8
  45.  
  46.         return print_url
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.