Я пытаюсь найти друзей по имени пользователя, который я передаю. Не будет работать, перепробовал все, что мог придумать.Пожалуйста, посмотрите и дайте мне несколько советов:
Хотя это не дает ошибок, отображается пустая страница.Никакие имена пользователей не отображаются.
include 'lib/EpiCurl.php';
include 'lib/EpiOAuth.php';
include 'lib/EpiTwitter.php';
include 'lib/secret.php';
$twitterObj = new EpiTwitter($consumer_key, $consumer_secret);
$oauth_token = 'xxxx'; //Yes I filled these out in the actual code
$oauth_token_secret = 'xxxx'; //Yes I filled these out in the actual code
$twitterObj->setToken($oauth_token, $oauth_token_secret);
$twitterInfo= $twitterObj->get_accountVerify_credentials();
$twitterInfo->response;
$twitterUsername = $twitterInfo->screen_name;
getFriends('csti');
function getFriends ($username){
global $twitterObj, $oauth_token, $oauth_token_secret, $twitterUsername;
$twitterFriends = $twitterObj->get('/statuses/friends.json');
$twitterFriends->response; //not sure if this is necessary but doesnt work either way.
try{
foreach($twitterFriends as $friend) {
echo $friend->screen_name;
}
}catch(EpiTwitterException $e){
echo $e->getMessage();
}
}