Well done! Nice to play with. Seeing it in context of each platform's default interface is *chefs kiss* a nice touch.
- It sounds like meta-crawlers for each platform might behave differently, and I noticed previews don't match what I see elsewhere, 0/2 in the 2 I know well, WhatsApp & Discord.
- It would be good to report redirects that happen in link following.
- Needs target url in URL query params or fragment.
Without data specifiable in URL it's a cute tool on a web page, whereas with data controlled by URL it's a native, shareable web utility. Just as cool URLs don't change, on the web URLs are the API.
I thought that one was unable to handle domains without a protocol, which makes it pretty much useless for normal business cases. I’ve never met a single non-technical person that understood what that https was, why they should add it, or didn’t get immeasurably bored if you tried to explain it…
Which would be even more of a reason to standardise an input field that handles web addresses as humans enter them, not machines prefer them. Yet, here we are.
Depending on how your forms are set up, this will cause the field to be marked as invalid as soon as the user interacts with any of the forms fields, if not on load. Also, this requires additional handling for copy paste etc.
No, that doesn’t work. Since the browser validates the field, it is marked as invalid unless there’s a protocol present. So you’re back to using the text field, but loose out on input optimisations for URLs.
I'd make it fetch the meta tags and image using the user agent string of the services you're showing previews for. For example, Twitter/X fetches meta tags with a user agent string of Twitterbot/1.0. Some sites may serve different content to different services in order to optimise the image for display on that service.
It also looks like your API may not be looking at Twitter-specific meta tags [0], as it just returns one set of metadata that's used by every preview. For example on https://govukvue.org I use the 'summary' card format, which shows a small image with the name and description beside it. But your tool renders it as if it's a 'summary_large_image'.
Does not appear to handle open graph correctly. For example, it displayed pixelated favicons resized to fit their containers, rather than the `og:image` in the head tag.
I usually use https://socialsharepreview.com/ but there are many, so I'm curios on how is this different/better and/or why did you decide to make it instead of using existing solutions?
Above broke for me for few of some of the previews. You have to click to see various previews and it's slow. OP's version shows them all on the same page, it's cleaner, has more previews and styled appropriately. Pretty obvious reasons!
I'm still dreaming about days when I can just write my website against the standarda and test it with my browser and then be happy if it works, because it will of course work in all other browsers too.
And now there is a tool where you can manually check how a ton of proprietary chat tools render some previews for your page.
And everyone gets mad as if that's the greatest thing since paper was invented.
You're failing on URLs that don't have HTTPS... that's awkward. I should be able to type any site and have it be smart enough to go to the URL and scan against the resolved URL. Like type in "blizzard.com" and have it load "https://www.blizzard.com/en-us/" for me.
Nice to see Discord and WhatsApp I guess, but what about LinkedIn, what about Pinterest. Or Slack (should be the same as Discord).
You don't include what to fix. Check out how socialsharepreview.com does it.
It has a bunch of helpful tips on what to fix to make your content unfurl correctly. Really useful for the marketing crowd that loves this stuff. These sites all use different formats, different character counts... It's good to share information about what to fix. Twitter cards, vs. Open Graph metadata, for example. (I didn't check but it'd be good to make sure you're loading the right ones for the right site.)
That's pretty cool! Get ready to keep these up to date monthly or become obsolete quickly.
One of the downsides of tools like this is that your URL needs to be available online so if there's an issue, your iteration loop is quite long.
In Polypane [1] I've built social media previews that work with any local URL but also let you overwrite that URL for the social media that display those. I built (and frequently maintain) previews for X/Twitter, Facebook, Slack, LinkedIn, Discord, Mastodon, Discord, Google Search, Bluesky, Mastodon and Threads. For all of those I have the design for their light and dark mode so you really can test everything. It also tells you what's missing and what is incompatible. Check it out: https://polypane.app/social-media-previews/
I know and it's becoming commonplace here, this is why I prefer free open source software instead so that we can ignore these ads for closed source software grifts altogether.
Is there a FOSS version of all of this that is open source? Otherwise one can make one such that these 'ads' don't need to exist and everyone can benefit from a FOSS version just in case an author chooses to shut their closed source one down.
Missing linkedin and also missing mastodon. Neat tool! If the page is missing something it would be helpful with some text on how to improve such as what should be done.
I thought exactly the same! Also, I'm not sure why, but LinkedIn is showing all of our pages with the wrong image. If someone is smart enough to figure it out please let me know. Get any blog-post from the godotengine.org site and paste it in linkedin and you'll see how the image that gets pulled is the auther of the post instead of the thumbnail of the article. I wasn't able to figure it out.
Your og:image meta tag is pointing to a .webp image, which I expect many services don't support as the OpenGraph image. It's probably falling back to the author photo because that's the first PNG or JPEG image on the page.
For a lot of SPA, we generate OpenGraph images if the user-agent matches a certain pattern, e.g. if it's Facebook, Discord, Twitter, etc. making a request.
If you're not mimicking the user agents of the platforms, it will often not be the same result.
I wish some formal standard for this would catch on, like a `META` HTTP request type or something. We try to pull in link metadata sometimes and get a Cloudflare captcha instead.
How do I know this is accurate? Does it actual use tools/APIs provided by the social media sites to generate the preview or does it just re-implement the same HTML based on observation (and therefore require constant updates to keep it in sync)?
This got me thinking and if I can ask something. If I do not care about how/what comes up when people share, for my personal website, should I care about any of these OG/Twitter/etc?
Do you just ignore and move on (I mean from these meta tags and the like -- not this particular tool)?
Some will use the very first image found in your page, or generate a preview that may not look good. If that doesn't bother you, then you shouldn't worry about it. You might be better off just having a logo for your website, or something that represents your "brand" or "identity" where it's the same for all pages, just so you avoid having a bot creating something for you in the future (which may not align with your ideas).
See this a lot. So you're seeing the same problem I am in my side projects -- Cloudflare, Fastly, etc must have an anti-abuse / anti-AI scraping setting and it's causing 403 errors when they detect you're not a legitimate client. They're whitelisting IP ranges of major social media servers though because it will get the link preview from Telegram, iMessage, etc.
Try it yourself with links to fastcompany.com or kickstarter.
Oh wow, I need this! I make a static site generator and making sure my users' contents appear well on social media sharing is very important. You already helped me find a few bugs. Thank you.
The X preview seems to crop on the left for a couple sites I tried. Not sure if that is accurate or not. Those sites look good in the other previews. I tend to use iMessage as a test and they look okay there, which I believe uses the X/Twitter tags.
Oh, this is nice! I would love to see a Slack unfurl sample. I don't entirely understand why Slack unfurls are unpredictable sometimes, but for example, an Instagram reel link unfurls just fine on Twitter or Facebook, but has no unfurl at all on Slack.
Thanks, I like the design of your site better than the other alternatives I found and it came exactly when I needed it. As other have mentioned, a way to run it locally would be great to not have to deploy live or create a tunnel in order to test it.
I built a service (https://yasl.at) which allows to generate short url with customised meta data via a simple API to deep-link into web games and specifically results/things worthwhile to share without having the headache of tampering in each game over and over again.
Neat little tool! It helped me figure out my websites logo is getting cropped on some socials. Making it easy to see how I need to modify it to fix the issue.
Cool idea, though it seems like it still requires some polish.
There are small issues, for example: the design of HN links on Discord does not seem to be correct.
I wish all thase sites that blast me with GDPR, newsletter, unsolicited chatbot, and 5 other popups could see that if on a mobile device the whole website us covered up in shit I have to deal with, I lose interest in the site and bounce
- It sounds like meta-crawlers for each platform might behave differently, and I noticed previews don't match what I see elsewhere, 0/2 in the 2 I know well, WhatsApp & Discord.
- It would be good to report redirects that happen in link following.
- Needs target url in URL query params or fragment.
https://linkpreview.xyz/#example.com
https://linkpreview.xyz/#url=https://example.com
https://linkpreview.xyz/?url=https://example.com
Without data specifiable in URL it's a cute tool on a web page, whereas with data controlled by URL it's a native, shareable web utility. Just as cool URLs don't change, on the web URLs are the API.
(Updated after seeing your tweet, https://x.com/fayazara/status/1830272619637047359 [top HN]+ [all critique]!)