mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Update tagesspiegel.recipe
This commit is contained in:
parent
c365574f30
commit
5e5c9f381c
@ -134,27 +134,27 @@ class Bloomberg(BasicNewsRecipe):
|
||||
cat = subhead = lede = auth = caption = ''
|
||||
|
||||
if 'primaryCategory' in data and data['primaryCategory'] is not None:
|
||||
cat = '<p id="cat">' + data['primaryCategory'] + '</p>'
|
||||
cat = '<p class="cat">' + data['primaryCategory'] + '</p>'
|
||||
|
||||
if len(data['abstract']) != 0 and len(data['abstract']) == 2:
|
||||
subhead = '<div id="subhead"><p>' + data['abstract'][0] + '</p><p>' + data['abstract'][1] + '</p></div>'
|
||||
subhead = '<div class="subhead"><p>' + data['abstract'][0] + '</p><p>' + data['abstract'][1] + '</p></div>'
|
||||
else:
|
||||
if 'summary' in data:
|
||||
subhead = '<div id="subhead"><p>' + data['summary'] + '</p></div>'
|
||||
subhead = '<div class="subhead"><p>' + data['summary'] + '</p></div>'
|
||||
|
||||
if 'byline' in data and data['byline'] is not None:
|
||||
auth = '<div><span id="auth">' + data['byline']\
|
||||
+ '</span> | <span id="time">' + data['publishedAt'][:-14] + '</span></div>'
|
||||
auth = '<div><span class="auth">' + data['byline']\
|
||||
+ '</span> | <span class="time">' + data['publishedAt'][:-14] + '</span></div>'
|
||||
|
||||
if 'ledeImageUrl' in data and data['ledeImageUrl'] is not None:
|
||||
lede = '<p id="img"><img src="{}">'.format(data['ledeImageUrl'])
|
||||
|
||||
if 'ledeDescription' in data and data['ledeDescription'] is not None:
|
||||
caption = '<span id="cap">' + data['ledeDescription'] + '</span>'
|
||||
caption = '<span class="cap">' + data['ledeDescription'] + '</span>'
|
||||
else:
|
||||
if 'lede' in data and data['lede'] is not None:
|
||||
if 'alt' in data['lede'] and data['lede']['alt'] is not None:
|
||||
caption = '<span id="cap">' + data['lede']['alt'] + '</span>'
|
||||
caption = '<span class="cap">' + data['lede']['alt'] + '</span>'
|
||||
|
||||
if m:
|
||||
time.sleep(3)
|
||||
|
@ -26,8 +26,22 @@ class TagesspiegelRss(BasicNewsRecipe):
|
||||
ignore_duplicate_articles = {'title', 'url'}
|
||||
remove_empty_feeds = True
|
||||
|
||||
def get_browser(self):
|
||||
return BasicNewsRecipe.get_browser(self, verify_ssl_certificates=False)
|
||||
|
||||
def get_cover_url(self):
|
||||
from datetime import date
|
||||
cover = 'https://img.kiosko.net/' + date.today().strftime('%Y/%m/%d') + '/de/tagesspiegel.750.jpg'
|
||||
return cover
|
||||
|
||||
keep_only_tags = [
|
||||
classes('ts-lead ts-article-body ts-intro ts-title ts-authors')
|
||||
dict(name = 'header', attrs={'class':'Bo'}),
|
||||
dict(name = 'div', attrs={'id':'story-elements'})
|
||||
]
|
||||
|
||||
remove_tags = [
|
||||
dict(name = 'aside'),
|
||||
classes('iqd_mainAd Bs')
|
||||
]
|
||||
|
||||
feeds = [
|
||||
@ -42,5 +56,3 @@ class TagesspiegelRss(BasicNewsRecipe):
|
||||
(u'Wissen', u'http://www.tagesspiegel.de/contentexport/feed/wissen')
|
||||
]
|
||||
|
||||
def get_masthead_url(self):
|
||||
return 'http://www.tagesspiegel.de/images/tsp_logo/3114/6.png'
|
||||
|
Loading…
x
Reference in New Issue
Block a user