Php Google Glass中的共享按钮在哪里发送数据?

Php Google Glass中的共享按钮在哪里发送数据?,php,google-glass,google-mirror-api,Php,Google Glass,Google Mirror Api,我刚刚开始探索谷歌眼镜的功能 我尝试做的是一个简单的玻璃器皿,当使用默认的“共享”功能时,它会从用户那里接收视频 我看到了,我设法上传了我的视频在;我还设法在服务器中实现了示例PHP项目代码 然而,我仍然无法弄清楚当我点击眼镜上的“共享”按钮时到底发生了什么:数据发送到哪里?到我的玻璃器皿,到通用镜像API,还是其他地方?我想Share函数的作用与中描述的类似,但不清楚如何实现 当我上传图片/视频时,演示项目的代码似乎更新了时间线事件;但若我并没有错的话,这段代码只是在用“我已收到您的数据!”标

我刚刚开始探索谷歌眼镜的功能

我尝试做的是一个简单的玻璃器皿,当使用默认的“共享”功能时,它会从用户那里接收视频

我看到了,我设法上传了我的视频在;我还设法在服务器中实现了示例PHP项目代码

然而,我仍然无法弄清楚当我点击眼镜上的“共享”按钮时到底发生了什么:数据发送到哪里?到我的玻璃器皿,到通用镜像API,还是其他地方?我想Share函数的作用与中描述的类似,但不清楚如何实现

当我上传图片/视频时,演示项目的代码似乎更新了时间线事件;但若我并没有错的话,这段代码只是在用“我已收到您的数据!”标题更新一个已经存在的项目

(我将在这里报告来自Google的
notify.php
sample:)的相关代码)


何时何地收到视频?我需要知道这一点,以便在收到数据时执行其他操作。

共享图片或视频通过Quickstart PHP项目中的
下载附件
功能下载

以下是函数:

 /**
 * Download an attachment's content.
 *
 * @param string item_id ID of the timeline item the attachment belongs to.
 * @param Google_Attachment $attachment Attachment's metadata.
 * @return string The attachment's content if successful, null otherwise.
 */
function download_attachment($item_id, $attachment) {
  $request = new Google_HttpRequest($attachment->getContentUrl(), 'GET', null, null);
  $httpRequest = Google_Client::$io->authenticatedRequest($request);
  if ($httpRequest->getResponseHttpCode() == 200) {
    return $httpRequest->getResponseBody();
  } else {
    // An error occurred.
    return null;
  }
}

是的,三个月前我自己算出来了,但完全忘了问这个问题。谢谢你的回答!我还想为第13行的
else
部分添加一条注释,因为我遇到这个问题也是因为我在一个代理后面,无法理解发生了什么。下面是一些错误处理:
if($httpRequest->getresponsehtpcode()==200){return$httpRequest->getResponseBody();}否则if($httpRequest->getresponsehtpcode()==302 | |$httpRequest->getresponsehtpcode()==301){$headers=$httpRequest->getResponseHeaders();返回下载附件($item_id,$attachment,$headers['location']);}否则{//发生错误。返回null;}
 /**
 * Download an attachment's content.
 *
 * @param string item_id ID of the timeline item the attachment belongs to.
 * @param Google_Attachment $attachment Attachment's metadata.
 * @return string The attachment's content if successful, null otherwise.
 */
function download_attachment($item_id, $attachment) {
  $request = new Google_HttpRequest($attachment->getContentUrl(), 'GET', null, null);
  $httpRequest = Google_Client::$io->authenticatedRequest($request);
  if ($httpRequest->getResponseHttpCode() == 200) {
    return $httpRequest->getResponseBody();
  } else {
    // An error occurred.
    return null;
  }
}