From 2bfa86c16d3ec2e7016cb39509985c2788ca8daa Mon Sep 17 00:00:00 2001 From: unkn0w7n <51942695+unkn0w7n@users.noreply.github.com> Date: Mon, 9 Sep 2024 10:36:00 +0530 Subject: [PATCH] Update scmp.recipe --- recipes/scmp.recipe | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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']: