Reputation: 30102
IS it possible to something like this:
http://api.twitter.com/1/statuses/followers/xxxxxx.json
but instead of list of people following you, list of people you are following?
Upvotes: 15
Views: 20908
Reputation: 1737
Looks like this is what you need:
https://api.twitter.com/1.1/friends/ids.json?id=:screen_name_or_user_id
https://dev.twitter.com/docs/api/1.1/get/friends/ids
Once you have the list of ID's returned, you can look them up by passing them as a comma delimited list to another API call:
http://api.twitter.com/1.1/users/lookup.json?user_id=[comma delimited list goes here]
https://dev.twitter.com/docs/api/1.1/get/users/lookup
Upvotes: 14
Reputation: 39
require_once('tmhOAuth.php');
require_once('tmhUtilities.php');
$profile_username = "abcdefg"; //twitter username
$oauth_access_token = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; //Your access token
$oauth_access_token_secret = "YYYYYYYYYYYYYYYYYYYYYYYYYY"; //Your access token secret
$consumer_key = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; //Your key
$consumer_secret = "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"; //Your secret key
$tmhOAuth = new tmhOAuth(array(
'consumer_key' => $consumer_key,
'consumer_secret' => $consumer_secret,
'user_token' => $oauth_access_token,
'user_secret' => $oauth_access_token_secret,
'curl_ssl_verifypeer' => false
));
$code = $tmhOAuth->request(
'GET',
$tmhOAuth->url('1.1/friends/ids'),
array(
'screen_name' => $profile_username,
'count' => '10'
)
);
$response = $tmhOAuth->response['response'];
$following_ids = json_decode($response, true);
print_r($following_ids);
Upvotes: 0
Reputation: 49
The new 1.1 URL you need to call is https://api.twitter.com/1.1/friends/ids.json
Full documentation is at https://dev.twitter.com/docs/api/1.1/get/friends/ids.
Upvotes: 3
Reputation: 554
You could use this:
https://api.twitter.com/1/friends.json?screen_name=bitboxer
that way you don't have to do two calls for id and than for details.
Upvotes: 6