简体   繁体   English

HTML URL作为预览而不是文本链接

[英]HTML URL as a preview instead of text link

So basically what i'm trying to achieve is when i put a link in a specific place, i want it to not show up as a text link but show up as a preview of the website (much like how chrome or firefox does it in the homepage) 因此,基本上,我想要实现的是将链接放置在特定位置时,我不希望它不显示为文本链接,而是显示为网站的预览(就像chrome或firefox的用法一样)主页)

I have tried with iframes but some sites do not get rendered in them. 我尝试使用iframe,但某些网站未在其中呈现。 Any idea how this could be done? 任何想法如何做到这一点?

You can achieve this using web capture service (virtual client that visits website and takes a screenshot and saves it as thumbnail, also parse the website metadata). 您可以使用Web捕获服务(访问网站并捕获屏幕截图并将其保存为缩略图,还解析网站元数据的虚拟客户端)实现此目的。

Your "special place" should parse the content and send the link to "your capture service" (there are some php/c#/java libraries) or a public web capture service. 您的“特殊位置”应该解析内容并将链接发送到“您的捕获服务”(有一些php / c#/ java库)或公共Web捕获服务。

Good luck, 祝好运,

example of public api: 公共API的示例:

http://api.thumbalizr.com/?url=https://stackoverflow.com/questions/41281928/html-url-as-a-preview-instead-of-text-link&width=160 http://api.thumbalizr.com/?url=https://stackoverflow.com/questions/41281928/html-url-as-a-preview-instead-of-text-link&width=160

http://www.thumbalizr.com/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM