【发布时间】:2017-02-02 22:47:21
【问题描述】:
我遇到了一个奇怪的问题,即即使用户通过推文发布了一些图像,API 控制台中也不会显示一些图像。
请注意此时间线中的第二条推文(无论如何现在),它以 ... 新 #play 'Between a Man and a Woman https://twitter.com/BatterseaBarge
在某些情况下,图像会被发布并在图像 url 上附加一个 :large。即。
<img src="https://pbs.twimg.com/media/exmaple.jpg:large"/>
现在,当这样的图像出现在帖子中并且我在 API 控制台上运行测试时,响应中不会出现 media_url。当然,当 :large 未附加到 url 时,它会出现在响应中。这是要测试的名称... BatterseaBarge https://dev.twitter.com/rest/tools/console
在我看来,这似乎是 API 中的一个错误。有人有什么想法吗?
后续回答:如下所述,这就是我的答案。我使用一个数组来获取 user_timeline 所以对于其他类似的人,希望它有所帮助。只是一个额外的说明,这确实显示了更多的东西,所以对于那些正在创建自己的 twitter 提要的人来说,加载时间可能也会减慢一点。缓存永远是最好的!
$fetchedTweets = $connection->get(
'statuses/user_timeline',
array(
'tweet_mode' => 'extended',
'screen_name' => $name,
'count' => $totalToFetch,
'exclude_replies' => $excludeReplies,
'images' => $description_image,
'include_rts' => $show_retweets,
)
);
【问题讨论】:
-
我不明白这个问题。推文 - twitter.com/BatterseaBarge/status/779978221479690240 - 有一张图片 - pbs.twimg.com/media/CtMJO81XgAAxDkn.jpg:large - 你在哪里看到错误?你在尝试什么 API 调用?
-
即使用户通过推文发布了一些图像,API 控制台中也不会显示,这是为什么呢?没有发生错误,这个媒体 url 只是没有显示在 API 工具中。我正在使用 twitter 提供的工具。 dev.twitter.com/rest/tools/console
标签: twitter-bootstrap twitter sttwitterapi