>我写了这段代码:
$twitterObj->setToken($_SESSION['ot'], $_SESSION['ots']);
$twitterFriends=$twitterObj->get_friendsIds(array('screen_name' => $_SESSION['username']));
$twitterFriends->response;
echo $twitterFriends->responseText;
foreach($twitterFriends as $friend) { echo $friend->id; }
但我明白这个:
{"errors":[{"code":37,"message":"Not authorized to use this endpoint"}]}
为什么?如何获取好友/关注ID?
根据这篇文章,你可能正在使用旧的twitter API URL。您是否尝试过更新您使用的推特库?