我似乎无法在状态中获取嵌入的 URL,例如,在 id=780804331608109057 -
https://twitter.com/i/web/status/780804331608109057
当我通过 GET /statuses/:id
检索此内容时, 与 include_entities
设置为 true,响应如下所示:
"text":"Here\u2019s WSJ \"An Underwhelming Trump-Clinton Debate\u201d trying to spin this as something other than a Clinton triumph\u2026 https:\/\/t.co\/dpkmphGI8k",
"truncated":true,
"entities":
{"hashtags":[],"symbols":[],"user_mentions":[],"urls":
[{"url":"https:\/\/t.co\/dpkmphGI8k",
"expanded_url":"https:\/\/twitter.com\/i\/web\/status\/780804331608109057",
"display_url":"twitter.com\/i\/web\/status\/7\u2026","indices":[114,137]}]},
"source":"\u003ca href=\"https:\/\/about.twitter.com\/products\/tweetdeck\"rel=\"nofollow\"\u003eTweetDeck\u003c\/a\u003e",....
在我的 Web 客户端上查看时,状态会显示指向 WSJ 的链接(通过 t.co 引用)我希望这些 URL 中的一个或两个显示在我的 API 响应中:
我在这里做错了什么?
最佳答案
工作人员对 TwitterCommunity website 的快速响应最令人欣慰的是:
You need to use tweet_mode=extended for the new longer Tweet format.
引用:https://twittercommunity.com/t/missing-media-property-in-entities/70388/4
搜索此新参数会在 dev.twitter.com 上生成适当的文档 - 可能存在有关此模式的更多文档链接。最显着的变化似乎是 key
text
不再用于非兼容模式 - 这就是状态文本所在的位置,除非您打开兼容模式,否则您现在必须使用 key full_text
https://dev.twitter.com/overview/api/upcoming-changes-to-tweets
关于twitter - 通过 REST API 在 Twitter 上获取状态并不总是返回媒体 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39730519/