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
Is there open-source code for making 'link preview' text and icons, like in facebook?
提问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 中,当您分享链接时,会创建一个带有图像标题和文本摘录的整洁小预览。这是一个例子..


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
回答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 库。它应该完全符合您的需求。

