我正在尝试通过以下方式获取 Google Plus 圈子中的人数:
$gplus_data = wp_remote_get('https://www.googleapis.com/plus/v1/people/'.$googleplus_user.'?key='.$api_key);
$gplus_data = json_decode($gplus_data['body'],true);
$gplus_count = $gplus_data['circledByCount'];
但我在最后一行出错了。
该json
对象看起来像:
{
"kind": "plus#person",
"etag": "\"pSkIL41GT2wmAdFX5kPW-Rf7v4A/dRTsk1U7uBI-ekf4-a2fEZl8eGs\"",
"urls": [
{
"value": "",
"label": ""
}
],
"objectType": "page",
"id": "",
"displayName": "",
"tagline": "",
"aboutMe": "",
"url": "",
"image": {
"url": ""
},
"isPlusUser": true,
"plusOneCount": 22556,
"circledByCount": 1398,
"verified": false,
"cover": {
"layout": "banner",
"coverPhoto": {
"url": "",
"height": 528,
"width": 940
},
"coverInfo": {
"topImageOffset": -126,
"leftImageOffset": 0
}
}
}
怎么了?