2
我在Google Plus上找到關於Post的文章 https://developers.google.com/+/api/latest/moments/insert如何將自動發佈到谷歌加PHP?
從那我們找到的例子展示瞭如何創建時刻。
$moment_body = new Google_Moment();
$moment_body->setType("http://schemas.google.com/AddActivity");
$item_scope = new Google_ItemScope();
$item_scope->setId("target-id-1");
$item_scope->setType("http://schemas.google.com/AddActivity");
$item_scope->setName("The Google+ Platform");
$item_scope->setDescription("A page that describes just how awesome Google+ is!");
$item_scope->setImage("https://developers.google.com/+/plugins/snippet/examples/thing.png");
$moment_body->setTarget($item_scope);
$momentResult = $plus->moments->insert('me', 'vault', $moment_body);
從谷歌API客戶端庫PHP我不是找到Google_ItemScope API和Google_Moment是Google_PlusMomentsService.php。所以不能嘗試這個例子。
有人知道嗎?或者有解決方案可以嘗試在谷歌加使用PHP自動發佈?
感謝
'注意事項:使用Google+ API目前提供的公開數據進行只讀訪問。所有API調用都需要OAuth 2.0令牌或API密鑰。「https://developers.google.com/+/api/ – waki
該示例使用舊版本的客戶端庫。嘗試在Google/Service/Plus.php中查找Google_Service_Plus_ItemScope,並以相同的方式使用它(同樣適用於Moment).https://github.com/google/google-api-php-client/blob/master/src/Google /Service/Plus.php#L2077 –