javascript 是否有用于制作“链接预览”文本和图标的开源代码,例如在 facebook 中?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4646147/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-25 14:24:50  来源:igfitidea点击:

Is there open-source code for making 'link preview' text and icons, like in facebook?

phpjqueryfacebookjavascript

提问by Ben Clayton

In facebook, when you share a link, a neat little preview is created with an image headline, and text excerpt. Here's an example..

在 Facebook 中,当您分享链接时,会创建一个带有图像标题和文本摘录的整洁小预览。这是一个例子..

Example Link

示例链接

Does anyone know if there's any open-source code (pref. php & javascript/jquery) that can generate something like this? Or should I just write it myself..

有谁知道是否有任何开源代码(首选 php 和 javascript/jquery)可以生成这样的东西?还是我自己写..

Cheers!

干杯!

采纳答案by mekwall

After a bit of Googling I found thisfor you.

经过一番谷歌搜索后,我为您找到了这个

It should take you through the steps on how to create something similar to Facebook share previews.

它应该会引导您完成有关如何创建类似于 Facebook 共享预览的步骤。

回答by SumairIrshad

Embedly provides a powerful API to convert standard URLs into embedded videos, images, and rich article previews.I Searched and found an easy way to do it.

Embedly 提供了一个强大的 API 来将标准的 URL 转换为嵌入的视频、图片和丰富的文章预览。我搜索并找到了一个简单的方法。

Just make a Get request to http://api.embed.ly/1/oembed?url=YOUR-URL. You will find everything in json Format.

只需向http://api.embed.ly/1/oembed?url=YOUR-URL发出 Get 请求。您将找到 json 格式的所有内容。

回答by Romain Piel

Have a look at bootstrap-linkpreviewjs library as well. It should fit exactly your needs.

也看看bootstrap-linkpreviewjs 库。它应该完全符合您的需求。