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

  1. from calibre.web.feeds.news import BasicNewsRecipe
  2.  
  3. class AdvancedUserRecipe1282101454(BasicNewsRecipe):
  4.     title = 'The Walrus Mag'
  5.     language = 'en'
  6.     __author__ = 'TonytheBookworm'
  7.     description = 'national general interest magazine about Canada and its place in the world'
  8.     publisher = 'Tony Stegall'
  9.     category = 'Canada, news'
  10.     oldest_article = 365
  11.     max_articles_per_feed = 100
  12.  
  13.     masthead_url = 'http://www.walrusmagazine.com/images/wordmark.png'
  14.     keep_only_tags    = [
  15.                          dict(name='h1'),
  16.                          dict(name='div', attrs={'id':['prbody']})
  17.       #                 ,dict(attrs={'id':['cxArticleText','cxArticleBodyText']})
  18.                         ]
  19.     feeds          = [
  20.                       ('Walrus Magazine', 'http://feeds.feedburner.com/WalrusFeatureArticles?format=xml'),
  21.  
  22.                      ]
  23.  
  24.  
  25.  
  26.  
  27.     def print_version(self, url):
  28.         split1 = url.split("/articles/")
  29.         #print 'THE SPLIT IS: ', split1
  30.         url1 = split1[0]
  31.         #print 'url1 is: ',url1
  32.         url2 = split1[1]
  33.         #print 'url2 is: ',url2
  34.  
  35.  
  36.   #need to convert to print_version
  37.   #originalversion is : http://www.walrusmagazine.com/articles/2010.09-frontier-no-one-can-hear-you-scream/
  38.   #printversion should be: http://www.walrusmagazine.com/print/2010.09-frontier-no-one-can-hear-you-scream/
  39.  
  40.  
  41.  
  42.  
  43.         print_url = url1 + '/print/' + url2
  44.         #print 'THIS URL WILL PRINT: ', print_url # this is a test string to see what the url is it will return
  45.         return print_url
  46.  
  47.