mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Update scmp.recipe
This commit is contained in:
parent
abe8c8b2a8
commit
2bfa86c16d
@ -47,9 +47,6 @@ def ts_date(x):
|
||||
dt = datetime.fromtimestamp(x/1000 + time.timezone)
|
||||
return dt.strftime('%b %d, %Y at %I:%M %p')
|
||||
|
||||
def auth(x):
|
||||
return ', '.join([a['name'] for a in x])
|
||||
|
||||
def load_article_from_json(raw, root):
|
||||
# open('/t/raw.json', 'w').write(raw)
|
||||
data = json.loads(raw)['props']['pageProps']['payload']['data']['article']
|
||||
@ -62,7 +59,8 @@ def load_article_from_json(raw, root):
|
||||
# E(article, 'p', replace_entities(data['subHeadline']['text']), style='font-style: italic; color:#202020;')
|
||||
for subh in data['subHeadline']['json']:
|
||||
process_node(subh, article)
|
||||
auth = ts_date(data['publishedDate']) + ' | ' + data['readingTime'] or '' + ' min read | ' + auth(data['authors'])
|
||||
auth = ts_date(data['publishedDate']) + ' | ' + str(data.get('readingTime', '')) + ' min read | ' \
|
||||
+ ', '.join([a['name'] for a in data['authors']])
|
||||
E(article, 'p', auth, style='color: #202020; font-size:small;')
|
||||
main_image_url = sub_img = ''
|
||||
for l in data['images']:
|
||||
|
Loading…
x
Reference in New Issue
Block a user