32 for line
in resp.text.split(
"\n"):
33 if line.startswith(
"[{"):
37 for result
in loads(json_str):
40 attachments = result.get(
'media_attachments', [])
41 images = [attachment[
'preview_url']
for attachment
in attachments
if attachment[
'type'] ==
'image']
45 title = result.get(
'card', {}).get(
'title')
47 title = html_to_text(result[
'content'])[:75]
53 'content': html_to_text(result[
'content']),
54 'thumbnail': thumbnail,
55 'publishedDate': datetime.strptime(result[
'created_at'],
'%Y-%m-%d %H:%M:%S'),