55 for result
in json[mastodon_type]:
56 if mastodon_type ==
"accounts":
60 'title': result[
'username'] + f
" ({result['followers_count']} followers)",
61 'content': result[
'note'],
62 'thumbnail': result.get(
'avatar'),
63 'publishedDate': datetime.strptime(result[
'created_at'][:10],
"%Y-%m-%d"),
66 elif mastodon_type ==
"hashtags":
67 uses_count = sum(int(entry[
'uses'])
for entry
in result[
'history'])
68 user_count = sum(int(entry[
'accounts'])
for entry
in result[
'history'])
72 'title': result[
'name'],
73 'content': f
"Hashtag has been used {uses_count} times by {user_count} different users",
77 raise ValueError(f
"Unsupported mastodon type: {mastodon_type}")