Improved recipe for Common Dreams

This commit is contained in:
Kovid Goyal 2010-01-23 17:41:11 -07:00
parent f1d8104450
commit 839b5618cb

View File

@ -2,17 +2,37 @@
from calibre.web.feeds.news import BasicNewsRecipe from calibre.web.feeds.news import BasicNewsRecipe
class CommonDreams(BasicNewsRecipe): class CommonDreams(BasicNewsRecipe):
# Identify the recipe
title = u'Common Dreams' title = u'Common Dreams'
description = u'Progressive news and views' description = u'Progressive news and views'
__author__ = u'XanthanGum' __author__ = u'XanthanGum'
language = 'en' language = 'en'
# Format the text
extra_css = '''
body{font-family:verdana,arial,helvetica,geneva,sans-serif ;}
h1{font-size: xx-large;}
h2{font-size: large;}
'''
# Pick no article older than seven days and limit the number of articles per feed to 100
oldest_article = 7 oldest_article = 7
max_articles_per_feed = 100 max_articles_per_feed = 100
feeds = [ # Remove everything before the article
(u'Common Dreams Headlines',
u'http://www.commondreams.org/feed/headlines_rss'), remove_tags_before = dict(name = 'div', attrs = {'id':'node-header'})
(u'Common Dreams Views', u'http://www.commondreams.org/feed/views_rss'),
(u'Common Dreams Newswire', u'http://www.commondreams.org/feed/newswire_rss') # Remove everything after the article
]
remove_tags_after = dict(name = 'div', attrs = {'class':'copyright-info'})
# Identify the news feeds
feeds = [(u'Headlines', u'http://www.commondreams.org/feed/headlines_rss'),
(u'Further News Articles', u'http://www.commondreams.org/feed/further_rss'),
(u'Views', u'http://www.commondreams.org/feed/views_rss'),
(u'Progressive Newswire', u'http://www.commondreams.org/feed/newswire_rss')]