Twitter 网络意图发布图像?

标签 twitter

是否可以通过 Twitter's Web Intents 将图像附加到推文中?现在,如果您在消息中放入图像,则图像的完整 URL 将放入消息中,而不是缩短和附加的图像 URL...

https://twitter.com/intent/tweet?original_referer=http%3A%2F%2Fwww.website.com%2F&text=MyText+http%3A%2F%2Fwww.website.com%2Fimg%2Fimage.png&url=www.someurl.com

Click here查看结果(没有附加图片,只有消息中的完整图片网址....)

当您将图像 URL 粘贴到 Twitter.com 上的推文中时,图像 URL 会自动缩短并将图像附加到推文,因此在您查看推文时会显示该图像。我正在寻找与 Web Intents 类似的东西。

最佳答案

您不能附加图像,但可以使用 Twitter Card .

With Twitter Cards, you can attach rich photos, videos and media experience to Tweets that drive traffic to your website.



本质上,您需要向页面添加一些元数据。当 Twitter 看到它时,它会自动在推文中插入一张图片。

对于 single photo ,您需要将此代码放在每个页面上(输入您自己的详细信息)
<meta name="twitter:card" content="photo" />
<meta name="twitter:site" content="@example" />
<meta name="twitter:title" content="My picture" />
<meta name="twitter:description" content="A description" />
<meta name="twitter:image" content="http://example.com/test.jpg" />
<meta name="twitter:url" content="http://example.com/mypage.html" />

关于Twitter 网络意图发布图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18321649/

相关文章:

php - header ("Location: mypage.php") 上传到其他服务器后不工作

ios - ParseTwitterUtils 内部服务器错误

javascript - Twitter 嵌入(使用 wordpress)并加载?

javascript - Twitter 如何管理要删除的推文?

python - 笨拙的文档

android - 使用 WebView 登录 Twitter

git - 是否有将 git 提交发布到 Twitter 的脚本?

twitter - Flume与TwitterSource和Elasticsearch Sink

python - 中间用户在转发链中的作用

javascript - JavaScript/jQuery 中的安全 Twitter OAuth 身份验证(加上服务器端助手)