【发布时间】:2014-11-21 14:48:10
【问题描述】:
我在我的一个网站的主页上运行了一个嵌入式脚本,该脚本在我们的 Google 日历上提取选定的事件列表并将它们列出在页面上。自 2011 年左右以来,我一直在运行此脚本,没有进行任何更改或修订。
昨天(可能是前一天)脚本开始抛出错误Forbidden Error 403。
这是脚本的 sn-p:
$ctz = 'America/Los_Angeles';
$calendarID[] = 'example.com_abcdefghijklmnop1234567890@group.calendar.google.com'; //Dept 1 Events
$calendarID[] = 'example.com_klmnopqrstuvwxyz0987654321@group.calendar.google.com'; //Dept 2 Events
/*...*/
$eventArray = buildEventList($calendarID, $ctz);
function buildEventList($calendarID=NULL,$ctz=NULL) {
require_once('Zend/Loader.php');
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_Calendar');
Zend_Loader::loadClass('Zend_Uri_Http');
$gdataCal = new Zend_Gdata_Calendar();
$query = $gdataCal->newEventQuery();
try {
/*...*/
}
catch (Zend_Gdata_App_Exception $e) {
$return = $e->getMessage();
}
return $return;
}
捕获结果显示以下错误消息{}:
Expected response code 200, got 403
<HTML>
<HEAD>
<TITLE>Forbidden</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Forbidden</H1>
<H2>Error 403</H2>
</BODY>
</HTML>
关于为什么开始发生这种情况或如何解决的任何想法?
注意事项: 我登录了我的每个 Google 日历,但它们的设置没有任何变化。它们仍然是公开共享的,并且 ID 没有改变 - 我在 Google 帐户中验证了所有内容。
通过持续研究获得的知识: 我想我可能需要一个 Google 开发者密钥——(1) 不确定如何获得,(2) 继续研究。
【问题讨论】:
标签: zend-framework google-calendar-api