View Single Post
Old 12-29-2009, 08:57 PM   #91
mtutalo
Junior Member
mtutalo began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2009
Device: Nook
I am trying to get the Providence Journal at www.projo.com but am not getting any articles. Any advice would be greatly appreciated. Here is my Recipe:

import re
from calibre.web.feeds.news import BasicNewsRecipe


class ProvidenceJournal(BasicNewsRecipe):

title = 'Providence Journal'
description = 'RI news'
__author__ = 'Kovid Goyal and Sujata Raman'
use_embedded_content = False
max_articles_per_feed = 20
language = 'en'


remove_javascript = True
no_stylesheets = True

extra_css = '''
#articleCopyright { font-family:Arial,helvetica,sans-serif ; font-weight:bold ; font-size:x-small ;}
p { font-family:"Times New Roman",times,serif ; font-weight:normal ; font-size:small ;}
body{font-family:arial,helvetica,sans-serif}
'''

feeds = [ ('Today\'s Highlights', 'http://www.projo.com/newskiosk/rss/projolocalnews.xml'),
('Politics', 'http://politicsblog.projo.com/index.xml'),
('7 to 7: Rhode Island\'s breaking news blog', 'http://newsblog.projo.com/index.xml'),
('Music', 'http://www.projo.com/newskiosk/rss/projomusic.xml')

]




remove_tags = [{'id':['pfmnav', 'ArticleCommentsWrapper']}]


def get_article_url(self, article):
return article.get('guid', article.get('link', None))

def print_version(self, url):
return url.rpartition('.')[0] + '_pf.html'

def postprocess_html(self, soup, first):
for div in soup.findAll(name='div', style=re.compile('margin')):
div['style'] = ''
return soup
mtutalo is offline   Reply With Quote