Quote:
Originally Posted by ddavtian
Hi all.
If you know how and have time, please create a recipe for "Contra Costa Times", for few sections, then I can add more myself.
Feeds are under http://www.contracostatimes.com/rss.
Thank you in advance!
David
|
Code:
#!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
'''
contracostatimes.com
'''
from calibre.web.feeds.news import BasicNewsRecipe
class Contracostatimes(BasicNewsRecipe):
title = u'Contra Costa Times'
__author__ = 'Darko Miletic'
description = 'News'
oldest_article = 7
max_articles_per_feed = 100
no_stylesheets = True
use_embedded_content = False
keep_only_tags = [dict(name='td', attrs={'class':'articleBox'})]
remove_tags_after = dict(name='div',attrs={'class':'articleBody'})
remove_tags = [
dict(name='div' , attrs={'class':'articleOptions' })
,dict(name='div', attrs={'class':'articleEmbeddedAdBox'})
,dict(name='div', attrs={'class':'packagesGrpBox'})
,dict(name='div', attrs={'id':'articleViewerGroup'})
,dict(name='div', attrs={'class':'articlePosition2'})
]
feeds = [(u'News', u'http://feeds.contracostatimes.com/mngi/rss/CustomRssServlet/571/200818.xml')]