Twitter API 1.1:从Twitter获取好友列表
如何获得通过我的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) 它实
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>"