Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Twitter API 1.1:从Twitter获取好友列表_Twitter - Fatal编程技术网

Twitter API 1.1:从Twitter获取好友列表

Twitter API 1.1:从Twitter获取好友列表,twitter,Twitter,如何获得通过我的twitter应用程序验证的用户的所有追随者(朋友)。根据推特文档,我尝试了以下一个 https://api.twitter.com/1.1/friends/ids.json?cursor=-1&screen_name=<user_screen_name> 您的呼叫需要使用oAuth,一个简单的URL呼叫将无法工作,即使屏幕名称已授权您的Twitter应用程序 您需要构造一个HTTP GET,以访问所显示的URL,但要使用格式正确的授权头(oAuth) 它实

如何获得通过我的twitter应用程序验证的用户的所有追随者(朋友)。根据推特文档,我尝试了以下一个

https://api.twitter.com/1.1/friends/ids.json?cursor=-1&screen_name=<user_screen_name>

您的呼叫需要使用oAuth,一个简单的URL呼叫将无法工作,即使屏幕名称已授权您的Twitter应用程序

您需要构造一个HTTP GET,以访问所显示的URL,但要使用格式正确的授权头(oAuth)

它实际上是一个web请求头,具有“Authorization”键和生成的值,如下所示:

OAuth realm="<name of realm, e.g. Twitter API>",
oauth_consumer_key="<your app key, you'll know this already from your twitter app>",
oauth_nonce="<this is basically a random alphanumeric string which your app should generate>",
oauth_timestamp="<number of seconds since 1/1/1970 00:00:00",
oauth_signature_method="HMAC-SHA1",
oauth_version="1.0",
oauth_signature="<this is the trickiest part, you basically have to hash the request + two secret params through a signing algorithm using the signature method above>"
OAuth领域=”,
oauth_消费者_密钥=”
OAuth realm="<name of realm, e.g. Twitter API>",
oauth_consumer_key="<your app key, you'll know this already from your twitter app>",
oauth_nonce="<this is basically a random alphanumeric string which your app should generate>",
oauth_timestamp="<number of seconds since 1/1/1970 00:00:00",
oauth_signature_method="HMAC-SHA1",
oauth_version="1.0",
oauth_signature="<this is the trickiest part, you basically have to hash the request + two secret params through a signing algorithm using the signature method above>"