mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Improve Reuters
This commit is contained in:
parent
1f903f4b70
commit
2dea2852a7
@ -16,23 +16,25 @@ class Reuters(BasicNewsRecipe):
|
|||||||
remove_javascript = True
|
remove_javascript = True
|
||||||
|
|
||||||
extra_css = '''
|
extra_css = '''
|
||||||
body{font-family:arial,helvetica,sans;}
|
body{font-family:arial,helvetica,sans;}
|
||||||
h1{ font-size:larger ; font-weight:bold; }
|
h1{ font-size:larger ; font-weight:bold; }
|
||||||
.byline{color:#006E97;font-size:x-small; font-weight:bold;}
|
.byline{color:#006E97;font-size:x-small; font-weight:bold;}
|
||||||
.location{font-size:x-small; font-weight:bold;}
|
.location{font-size:x-small; font-weight:bold;}
|
||||||
.timestamp{font-size:x-small; }
|
.timestamp{font-size:x-small; }
|
||||||
'''
|
'''
|
||||||
|
|
||||||
keep_only_tags = [dict(name='div', attrs={'class':'column2 gridPanel grid8'})]
|
keep_only_tags = [dict(name='div', attrs={'class':'column2 gridPanel grid8'})]
|
||||||
|
|
||||||
|
|
||||||
remove_tags = [dict(name='div', attrs={'id':['recommendedArticles','relatedNews','relatedVideo','relatedFactboxes']}),
|
remove_tags = [dict(name='div', attrs={'id':['recommendedArticles','relatedNews','relatedVideo','relatedFactboxes']}),
|
||||||
dict(name='p', attrs={'class':['relatedTopics']}),
|
dict(name='p', attrs={'class':['relatedTopics']}),
|
||||||
dict(name='a', attrs={'id':['fullSizeLink']}),
|
dict(name='a', attrs={'id':['fullSizeLink']}),
|
||||||
dict(name='div', attrs={'class':['photoNav','relatedTopicButtons','articleComments','gridPanel grid8','footerHalf gridPanel grid1','gridPanel grid2','gridPanel grid3']}),]
|
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
|
preprocess_regexps = [ (re.compile(i[0], re.IGNORECASE | re.DOTALL), i[1]) for i in
|
||||||
[
|
[
|
||||||
##(r'<HEAD>.*?</HEAD>' , lambda match : '<HEAD></HEAD>'),
|
##(r'<HEAD>.*?</HEAD>' , lambda match : '<HEAD></HEAD>'),
|
||||||
(r'<div id="apple-rss-sidebar-background">.*?<!-- start Entries -->', lambda match : ''),
|
(r'<div id="apple-rss-sidebar-background">.*?<!-- start Entries -->', lambda match : ''),
|
||||||
(r'<!-- end apple-rss-content-area -->.*?</body>', lambda match : '</body>'),
|
(r'<!-- end apple-rss-content-area -->.*?</body>', lambda match : '</body>'),
|
||||||
@ -40,18 +42,15 @@ class Reuters(BasicNewsRecipe):
|
|||||||
(r'<body>.*?<div class="contentBand">', lambda match : '<body>'),
|
(r'<body>.*?<div class="contentBand">', lambda match : '<body>'),
|
||||||
(r'<h3>Share:</h3>.*?</body>', lambda match : '<!-- END:: Shared Module id=36615 --></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">'),
|
(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'),
|
('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'),
|
||||||
('Science News', 'http://feeds.reuters.com/reuters/scienceNews?format=xml'),
|
('Science News', 'http://feeds.reuters.com/reuters/scienceNews?format=xml'),
|
||||||
('Environment News', 'http://feeds.reuters.com/reuters/Environment?format=xml'),
|
('Environment News', 'http://feeds.reuters.com/reuters/Environment?format=xml'),
|
||||||
('Technology News', 'http://feeds.reuters.com/reuters/technologyNews?format=xml'),
|
('Technology News', 'http://feeds.reuters.com/reuters/technologyNews?format=xml'),
|
||||||
('Oddly Enough News', 'http://feeds.reuters.com/reuters/oddlyEnoughNews?format=xml')
|
('Oddly Enough News', 'http://feeds.reuters.com/reuters/oddlyEnoughNews?format=xml')
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user