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

  1. #!/usr/bin/env  python
  2. __license__   = 'GPL v3'
  3. __author__    = 'Lorenzo Vigentini'
  4. __copyright__ = '2009, Lorenzo Vigentini <l.vigentini at gmail.com>'
  5. description   = 'the Escapist Magazine - v1.02 (09, January 2010)'
  6.  
  7. '''
  8. http://www.escapistmagazine.com/
  9. '''
  10.  
  11. from calibre.web.feeds.news import BasicNewsRecipe
  12.  
  13. class al(BasicNewsRecipe):
  14.     author        = 'Lorenzo Vigentini'
  15.     description   = 'The Escapist Magazine'
  16.  
  17.     cover_url      = 'http://cdn.themis-media.com/themes/escapistmagazine/default/images/logo.png'
  18.     title          = u'The Escapist Magazine'
  19.     publisher      = 'Themis media'
  20.     category       = 'Video games news, lifestyle, gaming culture'
  21.  
  22.     language       = 'en'
  23.     timefmt        = '[%a, %d %b, %Y]'
  24.  
  25.     oldest_article = 1
  26.     max_articles_per_feed = 100
  27.     use_embedded_content  = False
  28.     recursion             = 10
  29.  
  30.     remove_javascript     = True
  31.     no_stylesheets        = True
  32.  
  33.     feeds          = [
  34.                        (u'Daily News', u'http://www.escapistmagazine.com/rss/news/0.xml'),
  35.                        (u'Articles', u'http://www.escapistmagazine.com/rss/articles/0.xml')
  36.                      ]
  37.  
  38.     def print_version(self,url):
  39.         baseURL='http://www.escapistmagazine.com'
  40.         segments = url.split('/')
  41.         #basename = '/'.join(segments[:3]) + '/'
  42.         subPath= '/'+ segments[3] + '/'
  43.         articleURL=(segments[len(segments)-1])[0:5]
  44.  
  45.         if articleURL[4] =='-':
  46.             articleURL=articleURL[:4]
  47.  
  48.         printVerString='print/'+ articleURL
  49.         s=  baseURL + subPath + printVerString
  50.         return s
  51.  
  52.     keep_only_tags     = [
  53.                             dict(name='div', attrs={'id':'article'})
  54.                         ]
  55.  
  56.     remove_tags        = [
  57.                             dict(name='div',attrs={'id':['ad_leaderboard','print_notice','bottom_panel_container']})
  58.                          ]
  59.  
  60.