Update Reuters

This commit is contained in:
Kovid Goyal 2013-11-29 17:04:32 +05:30
parent 6420364abe
commit 2a6e721a66

View File

@ -1,5 +1,3 @@
import re
from calibre.web.feeds.news import BasicNewsRecipe
@ -14,6 +12,8 @@ class Reuters(BasicNewsRecipe):
max_articles_per_feed = 10
no_stylesheets = True
remove_javascript = True
auto_cleanup = True
auto_cleanup_keep = '//div[@class="relatedPhoto landscape"]'
extra_css = '''
body{font-family:arial,helvetica,sans;}
@ -23,29 +23,7 @@ class Reuters(BasicNewsRecipe):
.timestamp{font-size:x-small; }
'''
keep_only_tags = [dict(name='div', attrs={'class':'column2 gridPanel grid8'})]
remove_tags = [dict(name='div', attrs={'id':['recommendedArticles','relatedNews','relatedVideo','relatedFactboxes']}),
dict(name='p', attrs={'class':['relatedTopics']}),
dict(name='a', attrs={'id':['fullSizeLink']}),
dict(name='div', attrs={'class':['photoNav','relatedTopicButtons','articleComments','gridPanel grid8','footerHalf gridPanel grid1','gridPanel grid2','gridPanel grid3']}),
# Remove the Tweet, Share this, Email and Print links below article title too!
dict(name='div', attrs={'class':['columnRight']}),
]
preprocess_regexps = [ (re.compile(i[0], re.IGNORECASE | re.DOTALL), i[1]) for i in
[
##(r'<HEAD>.*?</HEAD>' , lambda match : '<HEAD></HEAD>'),
(r'<div id="apple-rss-sidebar-background">.*?<!-- start Entries -->', lambda match : ''),
(r'<!-- end apple-rss-content-area -->.*?</body>', lambda match : '</body>'),
(r'<script.*?>.*?</script>', lambda match : ''),
(r'<body>.*?<div class="contentBand">', lambda match : '<body>'),
(r'<h3>Share:</h3>.*?</body>', lambda match : '<!-- END:: Shared Module id=36615 --></body>'),
(r'<div id="atools" class="articleTools">.*?<div class="linebreak">', lambda match : '<div class="linebreak">'),
]]
feeds = [ ('Top Stories', 'http://feeds.reuters.com/reuters/topNews?format=xml'),
feeds = [('Top Stories', 'http://feeds.reuters.com/reuters/topNews?format=xml'),
('US News', 'http://feeds.reuters.com/reuters/domesticNews?format=xml'),
('World News', 'http://feeds.reuters.com/reuters/worldNews?format=xml'),
('Politics News', 'http://feeds.reuters.com/reuters/politicsNews?format=xml'),