2016-09-27 73 views
3

我似乎無法得到嵌入的URL的狀態,例如,在ID = 780804331608109057 -獲取狀態並不總是返回媒體的URL

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客戶端上查看時,狀態改爲顯示鏈接到WS Ĵ(通過t.co簡稱)我想什麼是一個或兩個URL來在我的API響應顯示:

  1. https://pbs.twimg.com/media/CtX5Sz8WIAAm4tq.jpg
  2. 這將是一個類似於「t.co短網址「其次是」/ HJs4kbmTKz「(我必須打破這一點,所以SO不會抱怨。)

我在做什麼錯在這裏?

回答

5

從上TwitterCommunity website一個職員的令人難以置信的快速反應是最欣慰:

您需要使用tweet_mode =擴展新較長分享Tweet格式。

編號:https://twittercommunity.com/t/missing-media-property-in-entities/70388/4

在這個新的參數,一個搜索產生的dev.twitter.com適當的文件 - 在這種模式下的多個文檔的鏈接可能存在在那裏。最顯著的變化似乎是關鍵text在非兼容模式不再使用 - 這就是狀態文本,除非你打開兼容模式,你必須現在使用的關鍵full_text

https://dev.twitter.com/overview/api/upcoming-changes-to-tweets

相關問題