mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Update Reuters
This commit is contained in:
parent
6420364abe
commit
2a6e721a66
@ -1,5 +1,3 @@
|
|||||||
import re
|
|
||||||
|
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
|
|
||||||
@ -14,6 +12,8 @@ class Reuters(BasicNewsRecipe):
|
|||||||
max_articles_per_feed = 10
|
max_articles_per_feed = 10
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
remove_javascript = True
|
remove_javascript = True
|
||||||
|
auto_cleanup = True
|
||||||
|
auto_cleanup_keep = '//div[@class="relatedPhoto landscape"]'
|
||||||
|
|
||||||
extra_css = '''
|
extra_css = '''
|
||||||
body{font-family:arial,helvetica,sans;}
|
body{font-family:arial,helvetica,sans;}
|
||||||
@ -23,29 +23,7 @@ class Reuters(BasicNewsRecipe):
|
|||||||
.timestamp{font-size:x-small; }
|
.timestamp{font-size:x-small; }
|
||||||
'''
|
'''
|
||||||
|
|
||||||
keep_only_tags = [dict(name='div', attrs={'class':'column2 gridPanel grid8'})]
|
feeds = [('Top Stories', 'http://feeds.reuters.com/reuters/topNews?format=xml'),
|
||||||
|
|
||||||
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'),
|
|
||||||
('US News', 'http://feeds.reuters.com/reuters/domesticNews?format=xml'),
|
('US News', 'http://feeds.reuters.com/reuters/domesticNews?format=xml'),
|
||||||
('World News', 'http://feeds.reuters.com/reuters/worldNews?format=xml'),
|
('World News', 'http://feeds.reuters.com/reuters/worldNews?format=xml'),
|
||||||
('Politics News', 'http://feeds.reuters.com/reuters/politicsNews?format=xml'),
|
('Politics News', 'http://feeds.reuters.com/reuters/politicsNews?format=xml'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user