home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_4015 < prev    next >
Encoding:
Text File  |  2009-12-10  |  2.0 KB  |  56 lines

  1. from calibre.web.feeds.news import BasicNewsRecipe
  2.  
  3. class RzeczpospolitaRecipe(BasicNewsRecipe):
  4.     __license__  = 'GPL v3'
  5.     __author__ = 'kwetal'
  6.     language = 'pl'
  7.     version = 1
  8.  
  9.     title          = u'Rzeczpospolita OnLine'
  10.     publisher = u'Presspublica Sp.'
  11.     category = u'News'
  12.     description = u'Newspaper'
  13.     oldest_article = 1
  14.     max_articles_per_feed = 100
  15.  
  16.     no_stylesheets = True
  17.     remove_javascript = True
  18.     encoding = 'utf-8'
  19.     # Seems to work best, but YMMV
  20.     simultaneous_downloads = 1
  21.  
  22.     feeds = []
  23.     feeds.append(u'http://www.rp.pl/rss/2.html')
  24.     feeds.append(u'http://www.rp.pl/rss/10.html')
  25.     feeds.append(u'http://www.rp.pl/rss/11.html')
  26.     feeds.append(u'http://www.rp.pl/rss/12.html')
  27.     feeds.append(u'http://www.rp.pl/rss/4.html')
  28.     feeds.append(u'http://www.rp.pl/rss/5.html')
  29.     feeds.append(u'http://www.rp.pl/rss/6.html')
  30.     feeds.append(u'http://www.rp.pl/rss/7.html')
  31.     feeds.append(u'http://www.rp.pl/rss/8.html')
  32.  
  33.     keep_only_tags =[]
  34.     keep_only_tags.append(dict(name = 'div', attrs = {'id' : 'storyp'}))
  35.  
  36.     remove_tags =[]
  37.     remove_tags.append(dict(name = 'div', attrs = {'id' : 'adk_0'}))
  38.     remove_tags.append(dict(name = 'div', attrs = {'class' : 'clr'}))
  39.     remove_tags.append(dict(name = 'div', attrs = {'id' : 'share_bottom'}))
  40.     remove_tags.append(dict(name = 'div', attrs = {'id' : 'copyright_law'}))
  41.  
  42.     extra_css = '''
  43.                     body {font-family: verdana, arial, helvetica, geneva, sans-serif ;}
  44.                     h1{text-align: left;}
  45.                     h2{font-size: medium; font-weight: bold;}
  46.                     p.lead {font-weight: bold; text-align: left;}
  47.                     .authordate {font-size: small; color: #696969;}
  48.                     .fot{font-size: x-small; color: #666666;}
  49.                     '''
  50.  
  51.     def print_version(self, url):
  52.         start, sep, rest = url.rpartition('/')
  53.         forget, sep, index = rest.rpartition(',')
  54.  
  55.         return start + '/' + index + '?print=tak'
  56.