twitter - 如何确保链接支持 Twitter 预览?

标签 twitter preview

首先,请注意我搜索了一个 SocialMediaStackExchange 来问这个问题,但似乎没有。

这就是我想知道的。向 twitter 发布推​​文时,如果它是 youtube 链接或特定网站的链接,则 twitter 将显示扩展功能,用户可以单击该功能在 Twitter 界面中预览媒体内容。

有谁知道这是否由 Twitter 决定,或者是否有某种方法可以更改我的网站以在 Twitter 上启用预览?

我想在我发布博客条目时让人们可以预览文章的第一部分内容。
这是一个示例:(只需添加链接,显示显示的预览内容)在这种情况下,它是 InfoWorld 上的文章。

Web link creates preview of content

Twitter 上有一个链接解释了扩展内容,但没有解释如何实现。
https://blog.twitter.com/2012/experience-more-with-expanded-tweets

最佳答案

您可能想查看“Twitter Cards”。它们的设置非常简单。您在页面的标题中添加几行代码,验证您的站点(一个自动化过程),然后您就离开了。

例如,这里是我的一 strip 有“预览”内容的推文 https://twitter.com/edent/status/516544061495193601

额外的 HTML 代码只是:

<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:creator" content="@edent">
<meta name="twitter:site" content="@edent">
<meta name="twitter:title" content="Tim Berners-Lee and the Freedom of The City">
<meta name="twitter:description" content="Last week, I had the privilege of being invited into the Guildhall to watch Tim Berners-Lee receive the Honorary Freedom of the City.  I was one of a dozen bloggers and tweeters asked to live tweet th">
<meta name="twitter:image:src" content="https://shkspr.mobi/blog/wp-content/uploads/2014/09/TimBL-Least-Well-Dressed-435x375.jpg">
<meta name="twitter:image:width" content="280">
<meta name="twitter:image:height" content="150">

不同风格的卡片有不同种类的预览 - 视频、图像、应用安装等。

关于twitter - 如何确保链接支持 Twitter 预览?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26528780/

相关文章:

javascript - 如何创建 JavaScript 条件来显示视频的图像预览或图片的图像预览?

visual-studio - Visual Studio "Publish Preview"功能在后台运行什么命令?

javascript - 推文按钮,用于推文 URL,不带 http ://www

ios - iOS开发中的社交网络集成哪个更好?

javascript - 如何使用 Zapier 代码发布推文

ios - Twitter登录解析iOS

ASP.NET Core 2.0 Preview 2 on IIS 错误 502.5

Android Studio 3.2.1 : Layout preview not working for all projects, 加载旧项目后

android - 取消停靠后,Android Studio 中的 "Docked Mode"设置中没有 "Preview"选项

c# - Tweetinvi 接收推文速度慢?备择方案?