How does telegram shows the Icon of some websites?

◇◆丶佛笑我妖孽 提交于 2019-12-03 08:30:56

问题


I am working with telegram on windows and its online version on web.telegram.org, when I share a link with my friend Telegram shows the icon or logo of some websites in that message:

Image

The first website is vajehyab.com and it has a favicon too (But do not showing that website icon), and the second is Stackoverflow and as you see the logo of stackoverflow and a litle description shows beside it.

Does websites do something or having some metadata that allow Telegram to access their logo, or it is an static program form Telegram programmers and the set some famous websites logo?


回答1:


Just add these tags to your website

<meta property="og:title" content="Title" />
<meta property="og:site_name" content="Site name"/>
<meta property="og:description" content="Description" />
<meta property="og:image" content="Link to your logo" />



回答2:


As well as adding what @Manikiran proposed you need to add this

<html prefix="og: http://ogp.me/ns#">

and use telegrams @WebpageBot afterwards



来源:https://stackoverflow.com/questions/30160294/how-does-telegram-shows-the-icon-of-some-websites

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!