Embed for Mastodon similar to Twitter?

Just confirming that Mastodon posts don’t have the same embed feature that Twitter does when you paste the link. Is that correct? Haven’t been able to get it to work.

Do you mean the link cards, where the post shows a title, image, and description? If so, those work well on Mastodon. However, there’s an issue with how OG images are compiled/used in Write.as. I mentioned it in another discussion. I’m hoping we’ll get a fix for it.

Actually the other way around. When you post a Mastodon link into a Write.as blog post, does it embed it all nicely like it does with Twitter? I don’t think so based on tests, but just checking.

Oh, my bad. I misunderstood. So Mastodon links don’t produce link cards in a Write.as post. That would be really nice. I have added Mastodon links in a couple of my posts and they indeed did not convert to link cards.

Perhaps there’s a specific way to do it. I’d actually love to know, because if that worked I could convert a bunch of screenshots in my Mastodon search article to simple links. Those link cards would be a great way to reduce the size of the post and improve accessibility.

As far as I know Write.as relies on Embed.ly for embeds, which doesn’t support Mastodon.

2 Likes

As far as I know, the only way to “sort of” do this is if your Mastodon instance supports embeds. You get an iframe embed, but it doesn’t look good like Twitter.

Yeah, the way auto-embeds work on Write.as is by detecting the domain name, sending that off to Embed.ly, and getting the rich embed in return. So for example with a youtube.com/... URL, we always know that we should embed a YouTube video, and so on. This is complicated with Mastodon because a post can live on any domain at all (and yes, Embed.ly doesn’t include support for it).

I do want to move away from Embed.ly to our own service (embed.as :wink:). If we do, we can also potentially support Mastodon embeds by using their oembed API.

Can’t put a timeline on that, but for now I’d recommend manually inserting the <iframe> code that Mastodon supplies. For the best results there, replace width="400" with style="width: 100%" in the code that they give you, and it should look a little nicer.

3 Likes

I suggested to Embed.ly that they start including Mastodon. They said if they receive enough requests, then they’ll do it. Please consider sending them a message from their website.

Just copy & paste this:

`

Hi! Can you please include Mastodon as one of your supported platforms for embeds? Thank you so much!

`

2 Likes

I’m gonna play with this a little. If I discover anything meaningful regarding responsiveness, I’ll share my findings back here.