通过 twitter API 调用获取用户推文不返回 media_url [英] Getting User tweets by twitter API call not returning media_url

查看:40
本文介绍了通过 twitter API 调用获取用户推文不返回 media_url的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到了用户的推文,但没有在返回的正确 twitter 对象中的实体下获取 media_url,甚至在 API 调用中的媒体中没有任何内容.为了测试,我使用了这个用户 twitterapi (https://twitter.com/twitterapi),我的 API 调用包括所有需要的参数,比如我通过调试我的 php 应用程序看到的访问机密的消费者密钥.

但是当我在 API 控制台中测试时将这个 url https://api.twitter.com/1.1/statuses/user_timeline.json?count=10&screen_name=twitterapi,我看到了entities.media.media_url 字段和值.

哪里错了,是不是缺少权限?

解决方案

Tweeter 更改用于大文本推文的 API,您必须将tweet_mode"参数添加到任何请求中.

https://developer.twitter.com/en/docs/tweets/tweet-更新

GET/1.1/statuses/show.json?id=123&tweet_mode=extended HTTP/1.1

I am getting tweets of a user but not getting media_url under entities in right twitter object returned, even nothing in media in the API call. For testing i used this user twitterapi (https://twitter.com/twitterapi), my API call includes all needed parameters like consumer key to access secret as i saw by debugging my php application.

But when i test in API console putting this url https://api.twitter.com/1.1/statuses/user_timeline.json?count=10&screen_name=twitterapi, i see entities.media.media_url field and value.

where is wrong, is there any permission missing?

解决方案

Tweeter changes API for large text tweets, you have to add the "tweet_mode" parameter to any request.

https://developer.twitter.com/en/docs/tweets/tweet-updates

GET /1.1/statuses/show.json?id=123&tweet_mode=extended HTTP/1.1

这篇关于通过 twitter API 调用获取用户推文不返回 media_url的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆