0
我想獲得我的所有關注者列表,我使用OAuth。我的代碼在這裏。 這段代碼我得到alll ID列表用逗號像如何使用php獲取twitter id的名稱
[51] => 378176058 [52] => 565040748 [53]
如何使用Twitter個人資料鏈接獲得所有followr的名字: (
<?php
require_once('tmhOAuth.php');
require_once('tmhUtilities.php');
$profile_username = "savanpaun"; //twitter username
$oauth_access_token = "Your access token"; //Your access token
$oauth_access_token_secret = "Your access token secret"; //Your access token secret
$consumer_key = "Your key"; //Your key
$consumer_secret = "Your secret key"; //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' => '300'
)
);
$response = $tmhOAuth->response['response'];
$following_ids = json_decode($response, true);
print_r($following_ids);
?>
但如何把它呢?我已經得到如[51] => 378176058 [52] => 565040748 [53] – 2014-12-05 11:59:01
的結果如果你提出這個請求,你會得到'[{「id」:378176058,「id_str」:「378176058」,「name 「:」Tina Gunn「,」screen_name「:」iTinaGunn「,... – 2014-12-05 13:23:14