Link Preview Embed System similar to discourse/discord

show loader on card face when url preview is fetching (theoretically works with multiple cards simultaneously fetching url previews)

1 Like

I like the implementation, looks great! I was doing this manually with images previously, native support is excellent and the choice to not use the embed and instead render it kinopio-style is *chef’s kiss* – great work, much appreciated, time to update my tweet cards!

Just as a relevant note since I didn’t see these services on the board you shared above: at work we’re tackling fetching oembed data by using Iframely (which is basically a cheap version of Embedly). We settled on Iframely due to cost, which is especially cheap (vs. Embedly) because Iframely measures unique URLs per hour so 10,000 requests for the same URL in 1 hour is charged as 1 request.

(Historically (before I joined the company) there were some issues with rate limiting from services like instagram when self-hosting (using essence), so migrating to an external service has greatly increased our ability to service every request for external media data – I don’t fully understand why instagram would be rate limiting us and this was relayed to me secondhand so buyer beware.)

2 Likes

Totally makes sense, but in this context it’s a bit apples and oranges:

I think an important distinction to make is between getting link metadata (stuff like linkpreview.net, http://peekalink.io) and running the actual site in an iframe embed (iframely, embedly)

the link metadata/unfurl approach just fetches a website’s oembed and meta tags in and lets me control how to render it. It doesn’t allow ‘dynamic functionality’, but the advantage is that it’s much faster and you can repeatedly load a bunch quickly (same reasons why twitter and slack take this approach).

Also because both kinopio and the linkPreview service each cache url preview data, this avoids issues with rate limits.

iFrames are basically a mini browser inside your page, they allow you to interact with the site in richer ways, but are slow/uncachable (you have to make seperate calls to the embedded site on each load), and require a lot of screen space per iframe to have those sites actually be useful (most sites don’t work so well in a 200px wide square :slight_smile: )

The iframe approach is most ideally suited to pages where the preview can take up the width of the browser, and there’s gonna be <2 embeds on the page

1 Like

(aside: when I built the glitch embed, to add medium.com support I had to go through embedly. The whole process was a huge pain)

2 Likes

Firstly, thank you!! I really appreciate this feature. Not sure if I’m the exception but I find myself hiding the url for all the links I paste now bc the title/preview is more than sufficient to help me identify cards. This is esp true if I’m making a mood board and just want the image to be the focus. Wondering if there’s a way to hide urls by default when I paste a link or have hide/show url available as a bulk action when I highlight multiple cards?

2 Likes

Hey rain,

how often are you adding cards with links? Are you adding them now mostly to update your older spaces or even on new spaces you’re adding links and hiding urls all the time?

It’s tricky to hide the url by default because I don’t know if a preview is available for about ~1-2 seconds. A bulk action might be something to look into tho if it’s a common/frequent enough need

alternatively, I might be able to reduce the contrast of urls that have a preview shown. Possibly reducing the need to hide the url? (but that might be confusing irl)

I understand your preference @rain to hide URLs by default. I feel like I would want that most of the time as well. URLs can be somewhat unsightly and especially detract when there is a nice preview image. but it also feels important to have all the content visible and upfront, so I see why @pirijan you played around with deemphasizing it.

not even say I like it, but one idea I had was to truncate the URL to just the domain, kinda like how some browsers do in the location bar (which btw I really don’t like).

don’t really have anything new to say, just adding my voice here (which apparently discourse is not happy about and wants me to encourage everyone else to get involved in the conversation…)

1 Like

I’m back after realizing this thread got a ton longer and somehow did not go up in my email.

Thanks for the feature! It’s been really nice to use. Another use case I found out I can now make a grid of free-to-use youtube music videos with their thumbnails because I found out making youtube thumbnails show up in notion page previews is not very striaghtforward.

Also I think there’s an issue with emojis showing up
image

2 Likes

I checked the request to linkpreview.net for that tweet, and I see the emojis okay there:

so might be a bug since it appears the kinopio client is getting it correctly…

1 Like