csensemakers / desci-sense

2 stars 2 forks source link

Add support for cards in Mastodon posts (as external ref URL) #32

Closed ronentk closed 11 months ago

ronentk commented 11 months ago

For example

https://fosstodon.org/@marcc/111404131751876120

see card field

{'id': '111404131751876120',
 'created_at': '2023-11-13T16:15:47.094Z',
 'in_reply_to_id': None,
 'in_reply_to_account_id': None,
 'sensitive': False,
 'spoiler_text': '',
 'visibility': 'public',
 'language': 'en',
 'uri': 'https://fosstodon.org/users/marcc/statuses/111404131751876120',
 'url': 'https://fosstodon.org/@marcc/111404131751876120',
 'replies_count': 0,
 'reblogs_count': 0,
 'favourites_count': 0,
 'edited_at': '2023-11-13T16:20:52.684Z',
 'content': '<p>I absolutely love <span class="h-card" translate="no"><a href="https://indieweb.social/@maggie" class="u-url mention">@<span>maggie</span></a></span>&#39;s visualization of the internet  as a cutout of the earth with multiple layers (<a href="https://maggieappleton.com/cozy-web" target="_blank" rel="nofollow noopener noreferrer" translate="no"><span class="invisible">https://</span><span class="">maggieappleton.com/cozy-web</span><span class="invisible"></span></a>). While you can visualize the internet as a... web, I think it is so abstract it does not cover the patterns that arise within it. Thinking about the internet as layers, where in each layer we are invited to act differently, makes a lot of sense!</p><p>Now I am curious what other models are out there for visualizing the web. :)</p>',
 'reblog': None,
 'application': None,
 'account': {'id': '110575424033925188',
  'username': 'marcc',
  'acct': 'marcc',
  'display_name': 'marcc.rooted',
  'locked': False,
  'bot': False,
  'discoverable': True,
  'group': False,
  'created_at': '2023-06-20T00:00:00.000Z',
  'note': '<p>Traveling the world while working remotely. <br />Writing an online cookbook with stories and recipes from all over the world. 📍Brazil</p>',
  'url': 'https://fosstodon.org/@marcc',
  'uri': 'https://fosstodon.org/users/marcc',
  'avatar': 'https://cdn.fosstodon.org/accounts/avatars/110/575/424/033/925/188/original/5e4546e22ac55aff.jpeg',
  'avatar_static': 'https://cdn.fosstodon.org/accounts/avatars/110/575/424/033/925/188/original/5e4546e22ac55aff.jpeg',
  'header': 'https://fosstodon.org/headers/original/missing.png',
  'header_static': 'https://fosstodon.org/headers/original/missing.png',
  'followers_count': 24,
  'following_count': 37,
  'statuses_count': 24,
  'last_status_at': '2023-11-13',
  'noindex': True,
  'emojis': [],
  'roles': [],
  'fields': []},
 'media_attachments': [],
 'mentions': [{'id': '109363798412961948',
   'username': 'maggie',
   'url': 'https://indieweb.social/@maggie',
   'acct': 'maggie@indieweb.social'}],
 'tags': [],
 'emojis': [],
 'card': {'url': 'https://maggieappleton.com',
  'title': 'The Dark Forest and the Cozy Web',
  'description': 'An illustrated diagram exposing the inner layers of the dark and cozy web',
  'language': 'en',
  'type': 'link',
  'author_name': '',
  'author_url': '',
  'provider_name': 'Maggie Appleton',
  'provider_url': '',
  'html': '',
  'width': 1200,
  'height': 630,
  'image': 'https://cdn.fosstodon.org/cache/preview_cards/images/008/229/894/original/29580d936aacc3dc.png',
  'image_description': 'The Dark Forest and the Cozy Web',
  'embed_url': '',
  'blurhash': 'U7Rp8$4n%MxuD%M{xuj[_3-;M{M|~q%MIURj',
  'published_at': None},
 'poll': None,
 'plain_content': "I absolutely love @maggie's visualization of the internet as a cutout of the\nearth with multiple layers (https://maggieappleton.com/cozy-web). While you\ncan visualize the internet as a... web, I think it is so abstract it does not\ncover the patterns that arise within it. Thinking about the internet as\nlayers, where in each layer we are invited to act differently, makes a lot of\nsense!\n\nNow I am curious what other models are out there for visualizing the web. :)"}