我正在尝试从公共Google+社区发布公开信息,我实际上是在使用Google API PHP Client,但我没有找到如何让社区投放...
请你帮助我吗?
感谢。
我的PHP代码段
require_once __DIR__.'/google-api-php-client/src/Google/autoload.php';
require_once __DIR__.'/google-api-php-client/src/Google/Service.php';
$client = new Google_Client();
$client->setDeveloperKey("API_KEY");
$plus = new Google_Service_Plus($client);
$activities = $plus->activities->listActivities("113527920160449995981", "public");
?>
<html><body><pre><? var_dump($activities);?></pre></body></html>
输出:
object(Google_Service_Plus_ActivityFeed)#15 (14) {
["collection_key":protected]=>
string(5) "items"
["internal_gapi_mappings":protected]=>
array(0) {
}
["etag"]=>
string(57) """"
["id"]=>
NULL
["itemsType":protected]=>
string(28) "Google_Service_Plus_Activity"
["itemsDataType":protected]=>
string(5) "array"
["kind"]=>
string(17) "plus#activityFeed"
["nextLink"]=>
NULL
["nextPageToken"]=>
NULL
["selfLink"]=>
NULL
["title"]=>
string(48) "Google+ List of Activities for Collection PUBLIC"
["updated"]=>
NULL
["modelData":protected]=>
array(1) {
["items"]=>
array(0) {
}
}
["processed":protected]=>
array(0) {
}
}
答案 0 :(得分:1)
你做不到。 Google+ API不允许访问社区。 p>
有一项开放功能请求,要求将此功能添加到API:https://code.google.com/p/google-plus-platform/issues/detail?id=639