私はnotify.phpにこれを持っています
foreach ($request['userActions'] as $i => $user_action) {
if ($user_action['type'] == 'SHARE') {
write("SHARE");
$timeline_item_id = $request['itemId'];
$timeline_item = $mirror_service->timeline->get($timeline_item_id);
foreach($timeline_item->getAttachments() as $j => $attachment) {
write(json_encode($attachment));
$attachment = $mirror_service->timeline_attachments->get($timeline_item_id, $attachment.getId());
$bytes = download_attachment($timeline_item_id, $attachment);
// Insert a new timeline card, with a copy of that photo attached
$echo_timeline_item = new Google_TimelineItem();
$echo_timeline_item->setText("Echoing your shared photo");
$echo_timeline_item->setNotification(
new google_NotificationConfig(array("level"=>"DEFAULT")));
insert_timeline_item($mirror_service, $echo_timeline_item, "image/jpeg", $bytes);
write("ECHO");
}
break;
}
}
問題はそれが言うことです
$attachment = $mirror_service->timeline_attachments->get($timeline_item_id, $attachment.getId());
その「.getId()」が見つかりません。
必要なファイルもすべて揃っています
require_once 'config.php';
require_once 'mirror-client.php';
require_once 'google-api-php-client/src/Google_Client.php';
require_once 'google-api-php-client/src/contrib/Google_MirrorService.php';
require_once 'util.php';
何か案は?