J'ai l'habitude de poster des liens vers des sites de news et si les aperçus (preview cards) comportaient le titre de l'article et une phrase d'intro sans illustration – ou alors un petit favicon dans un angle –, ça ne me poserait pas de problème.

Le format traditionnel impose une image par article et nous sommes noyés sous les photos des usual suspects, que je n'ai pas envie de voir 30 fois par jour, surtout sur ma timeline. L'IA générative étant à la mode, voilà une raison supplémentaire pour ne pas laisser quelqu'un d'autre choisir une illustration.

On peut y remédier en postant un court extrait du texte sous forme d'image, ce qui empêche l'affichage de la preview card. Mais il s'agit d'un hack et il faudrait le faire à chaque fois. Je pourrais ajouter un pixel transparent, mais j'y renonce à l'avance, pour les mêmes raisons. Et puis à force ils monopoliseraient l'onglet Média de mon profil.

Ou bien il faudrait se restreindre à mettre des liens vers le site npr.org, qui n'affiche jamais d'aperçu (for reasons), mais ça limiterait drastiquement le choix des sources. 😅

#PreviewCard #ControlFreak #PleaseSendHelp

Point d'attention : le meta tag `fediverse:creator` permettant d'afficher un lien vers le compte Mastodon de l'auteur n'est pas compatible avec un endpoint `oembed`.

#PreviewCard

En synthèse, pour la page pointée par l'URL :
- si un endpoint `oembed` existe au format JSON il sera utilisé, exclusivement
- si la page contient des données structurées au format JSON, elles seront utilisées
- si la page contient des meta tags Open Graph, ils seront utilisés, combinés aux données structurées
- sinon extraction de `lang`, `<title>` et `description`
- si la page contient le meta tag Twitter `twitter:player` alors son URL sera utilisée pour "embeder" une vidéo

#PreviewCard

En prévision du futur billet de blog j'ai créé un site Web permettant de tester différents cas de partage d'une URL sur Mastodon : https://aligny.gitlab.io/mastodon-preview-card/

#PreviewCard

Mastodon Preview Card

A simple website who provides pages to make some experiments with Mastodon URL sharing.

Mastodon Preview Card

Ces derniers jours j'ai essayé de démystifier la Preview Card Mastodon afin de comprendre la logique de récupération des données à partir d'un lien (méta donnés, données structurées, `oembed`), selon le média (image, vidéo) et la manière dont le résultat était affiché.
Faut que je motive pour en faire un billet de blog détaillé 😅

#PreviewCard

Wait.
Are you telling me #mastodon only creates pretty #previewcard s when the link is www(dot)youtube(dot)com .
m(dot) mobile links are not supported ?

They were too lazy to add that lil extra #regex ??

How
Lazy
Can
You be ?

https://ibb.co/Nk7K8wF
https://i.ibb.co/CXWQkxw/joined-image.png
https://woof.tech/tags/HidekiTaniuchi

function getVideoId(url) {
const regex = /(?:v=|\/embed\/|\.be\/|\/v\/)([a-zA-Z0-9_-]{11})/;
const match = url.match(regex);
return match ? match[1] : null;


Sigh !

#repost •acws #acws
joined-image

ImgBB

About #preprint / #scientificJournals bots:

Now that I'm at it, I'll try to get rid of the #PubMed image which is shipped as #previewCard of each and every post containing a #PubMed , 375kB which seems to be copied for each post times each server... I'm afraid it's GBs already of that trash.

Idk how to ask #Mastodon *not to* include a preview, but I've noted if there's a 1st link that fails to give a #previewCard, it seems to give it up, so trying to put the DOI link above in @Rxiv_mechanobio

Also,
funny how #akkoma n #pleroma aswell as #misskey just render a #previewcard lol

"Soundcloud ? We don't do that !!!1"

@Ardil

No, there is no way to turn the Preview Cards (as they're called techincally) and the resulting link image spam

They were adopted over objections voiced at Github, and were apparently a decision that Gargron had made out-of-band and was going to push forward, other opinions notwithstanding

They're space-consuming hot link images that completely ignore any subscription-free "gift link" included in the body of the post

I (in case you can't tell) detest them

#PreviewCard #Mastodon

@jackiegardina

Thanks

That said, the Preview Card cr*p #Gargron decided #Mastodon needed so Mastodon would look like the big Social Media Sites(tm) drives me fricken' nuts

Neither the #PreviewCard nor the bolded link below it are the gifted link

They're hot links to the standard #WaPo page that throws up a subscription nag in milliseconds

The gifted link is is very small text, under the text body of the post

Thanks, Gargron

Not

#SOTU SOTUResponse #Democracy #Election2024