加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

如何使用Zend / PHP插入非默认Google日历

发布时间:2020-12-13 21:34:15 所属栏目:PHP教程 来源:网络整理
导读:我正在尝试在Google日历中插入一个新事件,我可以通过以下方式做到: $sname = Zend_Gdata_Calendar::AUTH_SERVICE_NAME; // predefined service name for calendar$client = Zend_Gdata_ClientLogin::getHttpClient($userName,$password,$sname);$service =
我正在尝试在Google日历中插入一个新事件,我可以通过以下方式做到:

$sname = Zend_Gdata_Calendar::AUTH_SERVICE_NAME; // predefined service name for calendar
$client = Zend_Gdata_ClientLogin::getHttpClient($userName,$password,$sname);
$service = new Zend_Gdata_Calendar($client);

$event = $service->newEventEntry();
$event->title = $service->newTitle($name);
$event->when = array($when);
$newEvent = $service->insertEvent($event);

但是,这只会插入默认日历中.我试图使用insertEvent的URI参数来获取我需要去的地方:

$uri = "http://www.google.com/calendar/feeds/default/something@somethingelse.com/private/full";
$newEvent = $service->insertEvent($event,$uri);

这没效果.我已经尝试过编码和解码URI,这给了我不同的错误信息,但我无法让它工作.我一直在谷歌搜索解决方案几个小时没有运气.有人可以帮忙吗?

谢谢.
– 戴夫

解决方法

发现问题:
上面的URI不起作用:
“ http://www.google.com/calendar/feeds/default/something@somethingelse.com/private/full”;

不应该有默认部分.

此外,@符号应由编码替换.所以它应该是:
“http://www.google.com/calendar/feeds/something%40somethingelse.com/private/full”;

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读