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

  1. from calibre.web.feeds.news import BasicNewsRecipe
  2.  
  3. class ColumbusDispatchRecipe(BasicNewsRecipe):
  4.     __license__  = 'GPL v3'
  5.     __author__ = 'kwetal'
  6.     language = 'en'
  7.     version = 1
  8.  
  9.     title = u'The Columbus Dispatch'
  10.     publisher = u'The Columbus Dispatch'
  11.     category = u'News, Newspaper'
  12.     description = u'Daily newspaper from central Ohio'
  13.  
  14.     use_embedded_content = False
  15.     remove_empty_feeds = True
  16.     oldest_article = 1.2
  17.     max_articles_per_feed = 100
  18.  
  19.     no_stylesheets = True
  20.     remove_javascript = True
  21.     encoding = 'utf-8'
  22.     # Seems to work best, but YMMV
  23.     simultaneous_downloads = 2
  24.  
  25.     # Feeds from http://www.dispatch.com/live/content/rss/index.html
  26.     feeds = []
  27.     feeds.append((u'News: Local and state news', u'http://www.dispatch.com/live/static/crt/2_rss_localnews.xml'))
  28.     feeds.append((u'News: National news', u'http://www.dispatch.com/live/static/crt/2_rss_nationalnews.xml'))
  29.     feeds.append((u'News: Editorials', u'http://www.dispatch.com/live/static/crt/2_rss_editorials.xml'))
  30.     feeds.append((u'News: Columnists', u'http://www.dispatch.com/live/static/crt/2_rss_columnists.xml'))
  31.     feeds.append((u'News: Health news', u'http://www.dispatch.com/live/static/crt/2_rss_health.xml'))
  32.     feeds.append((u'News: Science news', u'http://www.dispatch.com/live/static/crt/2_rss_science.xml'))
  33.     feeds.append((u'Sports: OSU football', u'http://www.dispatch.com/live/static/crt/2_rss_osufootball.xml'))
  34.     feeds.append((u'Sports: OSU men\'s basketball', u'http://www.dispatch.com/live/static/crt/2_rss_osumensbball.xml'))
  35.     feeds.append((u'Sports: OSU women\'s basketball', u'http://www.dispatch.com/live/static/crt/2_rss_osuwomensbball.xml'))
  36.     feeds.append((u'Sports: OSU sports', u'http://www.dispatch.com/live/static/crt/2_rss_osusports.xml'))
  37.     feeds.append((u'Sports: Blue Jackets', u'http://www.dispatch.com/live/static/crt/2_rss_bluejackets.xml'))
  38.     feeds.append((u'Sports: Crew', u'http://www.dispatch.com/live/static/crt/2_rss_crew.xml'))
  39.     feeds.append((u'Sports: Clippers', u'http://www.dispatch.com/live/static/crt/2_rss_clippers.xml'))
  40.     feeds.append((u'Sports: Indians', u'http://www.dispatch.com/live/static/crt/2_rss_indians.xml'))
  41.     feeds.append((u'Sports: Reds', u'http://www.dispatch.com/live/static/crt/2_rss_reds.xml'))
  42.     feeds.append((u'Sports: Golf', u'http://www.dispatch.com/live/static/crt/2_rss_golf.xml'))
  43.     feeds.append((u'Sports: Outdoors', u'http://www.dispatch.com/live/static/crt/2_rss_outdoors.xml'))
  44.     feeds.append((u'Sports: Cavs/NBA', u'http://www.dispatch.com/live/static/crt/2_rss_cavaliers.xml'))
  45.     feeds.append((u'Sports: High Schools', u'http://www.dispatch.com/live/static/crt/2_rss_highschools.xml'))
  46.     feeds.append((u'Sports: Browns', u'http://www.dispatch.com/live/static/crt/2_rss_browns.xml'))
  47.     feeds.append((u'Sports: Bengals', u'http://www.dispatch.com/live/static/crt/2_rss_bengals.xml'))
  48.     feeds.append((u'Sports: Auto Racing', u'http://www.dispatch.com/live/static/crt/2_rss_autoracing.xml'))
  49.     feeds.append((u'Business News', u'http://www.dispatch.com/live/static/crt/2_rss_business.xml'))
  50.     feeds.append((u'Features: Weekender', u'http://www.dispatch.com/live/static/crt/2_rss_weekender.xml'))
  51.     feeds.append((u'Features: Life and Arts', u'http://www.dispatch.com/live/static/crt/2_rss_lifearts.xml'))
  52.     feeds.append((u'Features: Food', u'http://www.dispatch.com/live/static/crt/2_rss_food.xml'))
  53.     feeds.append((u'Features: NOW! for kids', u'http://www.dispatch.com/live/static/crt/2_rss_now.xml'))
  54.     feeds.append((u'Features: Travel', u'http://www.dispatch.com/live/static/crt/2_rss_travel.xml'))
  55.     feeds.append((u'Features: Home and Garden', u'http://www.dispatch.com/live/static/crt/2_rss_homegarden.xml'))
  56.     feeds.append((u'Features: Faith and Values', u'http://www.dispatch.com/live/static/crt/2_rss_faithvalues.xml'))
  57.     #feeds.append((u'', u''))
  58.  
  59.     keep_only_tags = []
  60.     keep_only_tags.append(dict(name = 'div', attrs = {'class': 'colhed'}))
  61.     keep_only_tags.append(dict(name = 'div', attrs = {'class': 'hed'}))
  62.     keep_only_tags.append(dict(name = 'div', attrs = {'class': 'subhed'}))
  63.     keep_only_tags.append(dict(name = 'div', attrs = {'class': 'date'}))
  64.     keep_only_tags.append(dict(name = 'div', attrs = {'class': 'byline'}))
  65.     keep_only_tags.append(dict(name = 'div', attrs = {'class': 'srcline'}))
  66.     keep_only_tags.append(dict(name = 'div', attrs = {'class': 'body'}))
  67.  
  68.     remove_tags = []
  69.     remove_tags.append(dict(name = 'div', attrs = {'id': 'middle-story-ad-container'}))
  70.  
  71.     extra_css = '''
  72.                 body {font-family:verdana,arial,helvetica,geneva,sans-serif ;}
  73.                 a {text-decoration: none; color: blue;}
  74.                 div.colhed {font-weight: bold;}
  75.                 div.hed {font-size: xx-large; font-weight: bold; margin-bottom: 0.2em;}
  76.                 div.subhed {font-size: large;}
  77.                 div.date {font-size: x-small; font-style: italic; color: #666666; margin-top: 0.4em; margin-bottom: 0.4em;}
  78.                 div.byline, div.srcline {font-size: small; color: #696969;}
  79.                 '''
  80.  
  81.