TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Linkpreview, see how your sites looks in social media and chat apps

362 点作者 fayazara9 个月前

44 条评论

mcint9 个月前
Well done! Nice to play with. Seeing it in context of each platform&#x27;s default interface is <i>*chefs kiss*</i> a nice touch.<p>- It sounds like meta-crawlers for each platform might behave differently, and I noticed previews don&#x27;t match what I see elsewhere, 0&#x2F;2 in the 2 I know well, WhatsApp &amp; Discord.<p>- <i>It would be good to report redirects that happen in link following.</i><p>- Needs target url in URL query params or fragment.<p><a href="https:&#x2F;&#x2F;linkpreview.xyz&#x2F;#example.com" rel="nofollow">https:&#x2F;&#x2F;linkpreview.xyz&#x2F;#example.com</a><p><a href="https:&#x2F;&#x2F;linkpreview.xyz&#x2F;#url=https:&#x2F;&#x2F;example.com" rel="nofollow">https:&#x2F;&#x2F;linkpreview.xyz&#x2F;#url=https:&#x2F;&#x2F;example.com</a><p><a href="https:&#x2F;&#x2F;linkpreview.xyz&#x2F;?url=https:&#x2F;&#x2F;example.com" rel="nofollow">https:&#x2F;&#x2F;linkpreview.xyz&#x2F;?url=https:&#x2F;&#x2F;example.com</a><p>Without data specifiable in URL it&#x27;s <i>a cute tool on a web page</i>, whereas with data controlled by URL it&#x27;s a <i>native, shareable web utility</i>. Just as <i>cool URLs don&#x27;t change</i>, on the web <i>URLs are the API</i>.<p><i>(Updated after seeing your tweet, <a href="https:&#x2F;&#x2F;x.com&#x2F;fayazara&#x2F;status&#x2F;1830272619637047359" rel="nofollow">https:&#x2F;&#x2F;x.com&#x2F;fayazara&#x2F;status&#x2F;1830272619637047359</a> [top HN]+ [all critique]!)</i>
FinnKuhn9 个月前
Great little tool, but please don&#x27;t force me to type <a href="https:&#x2F;&#x2F;" rel="nofollow">https:&#x2F;&#x2F;</a> and just add it automatically when I type something like example.com
评论 #41417920 未加载
评论 #41417945 未加载
评论 #41417886 未加载
matteason9 个月前
Neat tool. A couple of suggestions:<p>I&#x27;d make it fetch the meta tags and image using the user agent string of the services you&#x27;re showing previews for. For example, Twitter&#x2F;X fetches meta tags with a user agent string of Twitterbot&#x2F;1.0. Some sites may serve different content to different services in order to optimise the image for display on that service.<p>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&#x27;s used by every preview. For example on <a href="https:&#x2F;&#x2F;govukvue.org" rel="nofollow">https:&#x2F;&#x2F;govukvue.org</a> I use the &#x27;summary&#x27; card format, which shows a small image with the name and description beside it. But your tool renders it as if it&#x27;s a &#x27;summary_large_image&#x27;.<p>[0] <a href="https:&#x2F;&#x2F;developer.x.com&#x2F;en&#x2F;docs&#x2F;x-for-websites&#x2F;cards&#x2F;overview&#x2F;markup" rel="nofollow">https:&#x2F;&#x2F;developer.x.com&#x2F;en&#x2F;docs&#x2F;x-for-websites&#x2F;cards&#x2F;overvie...</a>
评论 #41417935 未加载
vinnymac9 个月前
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.
评论 #41417941 未加载
评论 #41417682 未加载
franciscop9 个月前
I usually use <a href="https:&#x2F;&#x2F;socialsharepreview.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;socialsharepreview.com&#x2F;</a> but there are many, so I&#x27;m curios on how is this different&#x2F;better and&#x2F;or why did you decide to make it instead of using existing solutions?
评论 #41417948 未加载
评论 #41417930 未加载
DitheringIdiot9 个月前
I built the opposite of this tool. It lets you generate a page to check which meta tags will generate a preview on a given platform.<p><a href="https:&#x2F;&#x2F;getoutofmyhead.dev&#x2F;link-preview-tester&#x2F;" rel="nofollow">https:&#x2F;&#x2F;getoutofmyhead.dev&#x2F;link-preview-tester&#x2F;</a>
pino829 个月前
I&#x27;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.<p>And now there is a tool where you can manually check how a ton of proprietary chat tools render some previews for your page.<p>And everyone gets mad as if that&#x27;s the greatest thing since paper was invented.<p>Not in a forum of funny media guys, but at HN.<p>Interesting times...
dbg314159 个月前
Why this tool over <a href="https:&#x2F;&#x2F;socialsharepreview.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;socialsharepreview.com&#x2F;</a> or <a href="https:&#x2F;&#x2F;www.opengraph.xyz&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.opengraph.xyz&#x2F;</a> or <a href="https:&#x2F;&#x2F;socialmediasharepreview.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;socialmediasharepreview.com&#x2F;</a> ?<p>Feedback...<p>You&#x27;re failing on URLs that don&#x27;t have HTTPS... that&#x27;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 &quot;blizzard.com&quot; and have it load &quot;<a href="https:&#x2F;&#x2F;www.blizzard.com&#x2F;en-us&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.blizzard.com&#x2F;en-us&#x2F;</a>&quot; for me.<p>Nice to see Discord and WhatsApp I guess, but what about LinkedIn, what about Pinterest. Or Slack (should be the same as Discord).<p>You don&#x27;t include what to fix. Check out how socialsharepreview.com does it.<p><a href="https:&#x2F;&#x2F;socialsharepreview.com&#x2F;?url=https%3A%2F%2Fnews.ycombinator.com%2F" rel="nofollow">https:&#x2F;&#x2F;socialsharepreview.com&#x2F;?url=https%3A%2F%2Fnews.ycomb...</a><p><a href="https:&#x2F;&#x2F;i.imgur.com&#x2F;LDXNYYR.png" rel="nofollow">https:&#x2F;&#x2F;i.imgur.com&#x2F;LDXNYYR.png</a><p>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&#x27;s good to share information about what to fix. Twitter cards, vs. Open Graph metadata, for example. (I didn&#x27;t check but it&#x27;d be good to make sure you&#x27;re loading the right ones for the right site.)
评论 #41417593 未加载
kilian9 个月前
That&#x27;s pretty cool! Get ready to keep these up to date monthly or become obsolete quickly.<p>One of the downsides of tools like this is that your URL needs to be available online so if there&#x27;s an issue, your iteration loop is quite long.<p>In Polypane [1] I&#x27;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&#x2F;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&#x27;s missing and what is incompatible. Check it out: <a href="https:&#x2F;&#x2F;polypane.app&#x2F;social-media-previews&#x2F;" rel="nofollow">https:&#x2F;&#x2F;polypane.app&#x2F;social-media-previews&#x2F;</a><p>[1] <a href="https:&#x2F;&#x2F;polypane.app&#x2F;" rel="nofollow">https:&#x2F;&#x2F;polypane.app&#x2F;</a>
评论 #41417601 未加载
shinryuu9 个月前
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.
评论 #41419957 未加载
评论 #41417957 未加载
holistio9 个月前
This is half-baked for now.<p>For a lot of SPA, we generate OpenGraph images if the user-agent matches a certain pattern, e.g. if it&#x27;s Facebook, Discord, Twitter, etc. making a request.<p>If you&#x27;re not mimicking the user agents of the platforms, it will often not be the same result.
评论 #41418434 未加载
pimlottc9 个月前
How do I know this is accurate? Does it actual use tools&#x2F;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)?
adithyassekhar9 个月前
The WhatsApp preview is not accurate at all compared to my Android. Is this designed around how it would look on iphones?
评论 #41417677 未加载
dmje9 个月前
Different to <a href="https:&#x2F;&#x2F;www.opengraph.xyz" rel="nofollow">https:&#x2F;&#x2F;www.opengraph.xyz</a> ?
评论 #41417322 未加载
seagullriffic9 个月前
The LinkedIn preview text made me laugh, thank you :)
renegat0x09 个月前
I often use my app to see what kind of properties page provides:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;rumca-js&#x2F;Django-link-archive&#x2F;blob&#x2F;main&#x2F;screenshots&#x2F;page_properties.PNG">https:&#x2F;&#x2F;github.com&#x2F;rumca-js&#x2F;Django-link-archive&#x2F;blob&#x2F;main&#x2F;sc...</a><p>It can display open graph, RSS, YouTube props<p>It is a selfhostable app mostly for RSS reading
Brajeshwar9 个月前
This got me thinking and if I can ask something. If I do not care about how&#x2F;what comes up when people share, for my personal website, should I care about any of these OG&#x2F;Twitter&#x2F;etc?<p>Do you just ignore and move on (I mean from these meta tags and the like -- not this particular tool)?
评论 #41420635 未加载
评论 #41417689 未加载
评论 #41417911 未加载
reporter79 个月前
&gt; failed to fetch meta tags<p>See this a lot. So you&#x27;re seeing the same problem I am in my side projects -- Cloudflare, Fastly, etc must have an anti-abuse &#x2F; anti-AI scraping setting and it&#x27;s causing 403 errors when they detect you&#x27;re not a legitimate client. They&#x27;re whitelisting IP ranges of major social media servers though because it will get the link preview from Telegram, iMessage, etc.<p>Try it yourself with links to fastcompany.com or kickstarter.
breck9 个月前
Oh wow, I need this! I make a static site generator and making sure my users&#x27; contents appear well on social media sharing is very important. You already helped me find a few bugs. Thank you.<p>Here&#x27;s my user test: <a href="https:&#x2F;&#x2F;www.loom.com&#x2F;share&#x2F;b7cb729ed84b407d95ee764ab60c7dd3?sid=695c8b59-427a-4697-9dcd-2989f5bff142" rel="nofollow">https:&#x2F;&#x2F;www.loom.com&#x2F;share&#x2F;b7cb729ed84b407d95ee764ab60c7dd3?...</a>
izakfr9 个月前
This is really awesome, I’ve been looking for this exact tool. Putting the preview in the context of a real message &#x2F; post makes it more useful.
评论 #41417953 未加载
nojs9 个月前
Its worth noting that Google regularly rewrites title tags, so that part is probably not accurate.<p><a href="https:&#x2F;&#x2F;developers.google.com&#x2F;search&#x2F;blog&#x2F;2021&#x2F;08&#x2F;update-to-generating-page-titles" rel="nofollow">https:&#x2F;&#x2F;developers.google.com&#x2F;search&#x2F;blog&#x2F;2021&#x2F;08&#x2F;update-to-...</a>
iJohnDoe9 个月前
Very helpful. Great job!<p>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&#x2F;Twitter tags.
wlonkly9 个月前
Oh, this is nice! I would love to see a Slack unfurl sample. I don&#x27;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.
johnchristopher9 个月前
It&#x27;s interesting that you are adding the cruft around each preview (e.g.: the facebook comment form, etc.).<p>That&#x27;s what differentiate from <a href="https:&#x2F;&#x2F;opengraph.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;opengraph.dev&#x2F;</a> that I use regularly.
audiala9 个月前
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.
Scotrix9 个月前
very nice!<p>I built a service (<a href="https:&#x2F;&#x2F;yasl.at" rel="nofollow">https:&#x2F;&#x2F;yasl.at</a>) which allows to generate short url with customised meta data via a simple API to deep-link into web games and specifically results&#x2F;things worthwhile to share without having the headache of tampering in each game over and over again.<p>You can read more about one of my use-cases specifically here: <a href="https:&#x2F;&#x2F;medium.com&#x2F;@degola&#x2F;supercharge-your-links-with-custom-metadata-and-qr-codes-the-ultimate-url-shortening-service-7faee2f88097" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;@degola&#x2F;supercharge-your-links-with-custo...</a><p>Open to do some backlinking @fayazara?
lylo9 个月前
I’ve been using the Banner Bear one for years. Works for me!<p><a href="https:&#x2F;&#x2F;www.bannerbear.com&#x2F;tools&#x2F;twitter-card-preview-tool&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.bannerbear.com&#x2F;tools&#x2F;twitter-card-preview-tool&#x2F;</a>
cloudking9 个月前
I just use the official Meta one, although it requires a login: <a href="https:&#x2F;&#x2F;www.facebook.com&#x2F;tools&#x2F;debug&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.facebook.com&#x2F;tools&#x2F;debug&#x2F;</a>
ebloom199 个月前
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.
moonleay9 个月前
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.
valbis9 个月前
straight to the point without any fuss. well done
steelcm9 个月前
Looks good, but doesn&#x27;t implement video previews, which seems to be the case with most of these OG preview tools.
hoherd9 个月前
Currently this appears to not handle quotes in titles properly, rendering them as &amp;#39; instead of an ascii quote.
piyushtechsavy9 个月前
Very interesting tool, usually developers check everything by posting links on these platforms.
评论 #41423828 未加载
dorpstein9 个月前
This is really cool. I’m shipping a side project soon and this made me rethink the preview.
dheera9 个月前
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
gejose9 个月前
Please change the text input to not autocorrect words.<p>Great tool!
fayazara9 个月前
Linkedin and Telegram previews now available
sh4jid9 个月前
It&#x27;s amazing! Thanks for sharing.
Jackson__9 个月前
This will be very useful for the half-decade we might have left until links to anything except the top 5 sites are auto-filtered.
celtictechie9 个月前
you&#x27;ve reminded my how old is my banner image... solid work, thanks!
anonymousd3vil9 个月前
This is some good stuff!
aitchnyu9 个月前
It breaks on Firefox.
darkbatman9 个月前
I tried google.com. It says invalid url. looks half baked. can you not force to write protocol.
评论 #41417969 未加载