我通过 Google + php API 插入了很多时刻。这些是我的代码。
$client = new Google_Client();
$client->setClientId($client_id);
$client->setClientSecret($client_ecret);
$client->setRedirectUri($redirect_uri);
$requestVisibleActions = array(
'http://schemas.google.com/AddActivity',
'http://schemas.google.com/ReviewActivity',
'http://schemas.google.com/CreateActivity');
$client->setRequestVisibleActions($requestVisibleActions);
$plus = new Google_PlusService($client);
if (isset($_GET['code'])) {
//https://www.googleapis.com/auth/userinfo.email
$client->authenticate($_GET['code']);
}
if ($client->getAccessToken()) {
$moment_body = new Google_Moment();
$moment_body->setType("http://schemas.google.com/CreateActivity");
$item_scope = new Google_ItemScope();
Zend_Log::INFO);
$item_scope->setId('1343');
$item_scope->setType("http://schemas.google.com/CreateActivity");
$item_scope->setType("http://schema.org/CreativeWork");
$item_scope->setName("Test");
$item_scope->setDescription(“This is just a test.”);
$moment_body->setTarget($item_scope);
$momentResult = $plus->moments->insert('me', 'vault', $moment_body);
响应如下:
array(5) { ["kind"]=> string(11) "plus#moment" ["type"]=> string(40) "http://schemas.google.com/CreateActivity" ["target"]=> array(4) { ["kind"]=> string(14) "plus#itemScope" ["id"]=> string(4) "1343" ["description"]=> string(20) "This is just a test." ["name"]=> string(4) "Test" } ["result"]=> array(1) { ["kind"]=> string(14) "plus#itemScope" } ["id"]=> string(75) "Eg0xMzc1NTE2ODc2MDYzGJGDxrC2ufClwgEyAhABQgYYofONXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" }
看来瞬间发布成功了。正确的?
问题是我可以在哪里看到它。我在Google Plus上登录。我没有看到刚刚插入的那一刻。为什么?