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

  1.  
  2. from calibre.web.feeds.news import BasicNewsRecipe
  3.  
  4. class ProPublicaRecipe(BasicNewsRecipe):
  5.     __license__  = 'GPL v3'
  6.     __author__ = 'kwetal'
  7.     language = 'en'
  8.     version = 1
  9.  
  10.     title = u'Pro Publica'
  11.     publisher = u'ProPublica.org'
  12.     category = u'Political blog'
  13.     description = u'Independent investigative journalism in the public interest.'
  14.  
  15.     oldest_article = 14
  16.     max_articles_per_feed = 100
  17.     use_embedded_content = False
  18.  
  19.     remove_empty_feeds = True
  20.     no_stylesheets = True
  21.     remove_javascript = True
  22.  
  23.     keep_only_tags = []
  24.     keep_only_tags.append(dict(name = 'div', attrs = {'class': 'article'}))
  25.  
  26.     remove_tags = []
  27.     remove_tags.append(dict(name = 'div', attrs = {'id': 'rollups'}))
  28.     remove_tags.append(dict(name = 'div', attrs = {'class': 'follow_info'}))
  29.     remove_tags.append(dict(name = 'ul', attrs = {'class': 'long-tools-top'}))
  30.     remove_tags.append(dict(name = 'ul', attrs = {'id': 'share-box'}))
  31.     remove_tags.append(dict(name = 'div', attrs = {'class': 'tags'}))
  32.     remove_tags.append(dict(name = 'ul', attrs = {'class': 'long-tools'}))
  33.     remove_tags.append(dict(name = 'ul', attrs = {'id': 'share-box2'}))
  34.     remove_tags.append(dict(name = 'p', attrs = {'id': 'original-url'}))
  35.  
  36.     feeds = []
  37.     feeds.append((u'Top Stories', u'http://feeds.propublica.org/propublica/main'))
  38.     feeds.append((u'Stimulus', u'http://feeds.propublica.org/propublica/watchdog/stimulus'))
  39.     feeds.append((u'Bailout', u'http://feeds.propublica.org/propublica/watchdog/bailout'))
  40.     feeds.append((u'Business', u'http://feeds.propublica.org/propublica/business-money'))
  41.     feeds.append((u'Justice', u'http://feeds.propublica.org/propublica/justice-law'))
  42.     feeds.append((u'Energy & Environment', u'http://feeds.propublica.org/propublica/energy-environment'))
  43.     feeds.append((u'Government & Politics', u'http://feeds.propublica.org/propublica/government-politics'))
  44.     feeds.append((u'Health & Science', u'http://feeds.propublica.org/propublica/health-science'))
  45.     feeds.append((u'Media & Technology', u'http://feeds.propublica.org/propublica/media-technology'))
  46.     feeds.append((u'National Security', u'http://feeds.propublica.org/propublica/national-security'))
  47.     #feeds.append((u'', u''))
  48.  
  49.     conversion_options = {'comments': description, 'tags': category, 'language': 'en',
  50.                           'publisher': publisher}
  51.  
  52.     extra_css = '''
  53.                 body{font-family:verdana,arial,helvetica,geneva,sans-serif;}
  54.                 img {float: left; margin-right: 0.5em;}
  55.                 h1 {text-align: left;}
  56.                 a, a[href] {text-decoration: none; color: blue;}
  57.                 div.cat {font-size: x-small; color: #666666; margin-bottom: 0.1em;}
  58.                 div.info {font-size: small; color: #696969;}
  59.                 '''
  60.  
  61.