我可以让谁在我的推文中点击图片?

Who can I make the image in my tweet click able?

我有一个简单的 tweepy 脚本,post 一张图片。我希望用户单击图像并转到我指定的 URL。

我可以做到...

import tweepy

... auth stuff ...
api = tweepy.API(auth)

str1 = "blah blah blah click here: http://example.com/cute_puppy"
r = api.update_with_media('cutepuppy.png', status=str1)

...但我更希望我的推特关注者可以直接点击图片。

import tweepy

... auth stuff ...
api = tweepy.API(auth)

str1 = "blah blah blah click on the cute puppy pic!"
r = api.update_with_media('cutepuppy.png', status=str1)

...但我不知道如何让媒体 cutepuppy.png 表现得像 link。

你不能。 Twitter 不支持这一点,无论是在其网站上发布的帖子还是通过其 API 发布的帖子——单击附加到推文的媒体对象将始终查看该对象。

但是,您可以将 link 分享到设置了 Twitter 卡片以提供与 link 相关的图像的网站。详情请参考推特Twitter Cards documentation