diff --git a/recipes/scmp.recipe b/recipes/scmp.recipe index fcaba61257..409ce70c47 100644 --- a/recipes/scmp.recipe +++ b/recipes/scmp.recipe @@ -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']: