过滤Twitter API GET用户/显示结果


Filter Twitter API GET user/show results

我使用PHP包装器来调用我的Twitter API。

我正在尝试为我的帐户获得追随者计数,我正在使用

$url = 'https://api.twitter.com/1.1/users/show.json';
$getfield = '?screen_name=symphaticidiot';
$requestMethod = 'GET';
$twitter = new TwitterAPIExchange($settings);
$response = $twitter->setGetfield($getfield)
                ->buildOauth($url, $requestMethod)
                ->performRequest();
var_dump(json_decode($response));

可以工作并且显示信息。我如何过滤它,使它只显示follower_count而不是

object(stdClass)#2 (43) { ["id"]=> int(391356688) ["id_str"]=> string(9) "391356688"                                         ["name"]=> string(8) "It's Dom" ["screen_name"]=> string(14) "symphaticidiot" ["location"]=> string(13) "Hull, England" ["description"]=> string(110) "Specialised Generalist, #webguy, #poet, #IT Techie and the guy who has @amb_freeman as his amazing girlfriend." ["url"]=> string(22) "http://t.co/YSoqD2K0NZ" ["entities"]=> object(stdClass)#3 (2) { ["url"]=> object(stdClass)#4 (1) .....

我使用以下代码使其工作

$url = 'https://api.twitter.com/1.1/users/show.json';
$getfield = '?screen_name=symphaticidiot';
$requestMethod = 'GET';
$twitter = new TwitterAPIExchange($settings);
$response = $twitter->setGetfield($getfield)
                    ->buildOauth($url, $requestMethod)
                    ->performRequest();
$json_output = json_decode($response);
$followers = $json_output->followers_count