doulan8846 2016-02-12 06:10
浏览 107

使用谷歌客户端php api从谷歌日历中获取更新的事件

I am trying to sync google calendar with my website.I am using google client php api. Till now i am able to get all the events from google calendar.Is there a way to get only the updated events from google calendar. Below is the code to get the events from google calendar

$client = new Google_Client();

$client->setApplicationName( $app_name ); 
$client->setDeveloperKey( $app_key ); 
$cal = new Google_Service_Calendar( $client );
$calendarId = $app_id;

$params = array(      
  'singleEvents' =>   true,
  'orderBy'      =>   'startTime',
);
$events = $cal->events->listEvents($calendarId, $params);
foreach ( $events->getItems() as $event ) {
echo $event->getSummary();
}
  • 写回答

3条回答 默认 最新

  • dragonsun2005 2016-02-12 07:21
    关注

    I guess you can only use orderBy parameter. It has a value "updated" that orders the events by last modification time (ascending). Here is the documentation.

    评论

报告相同问题?

悬赏问题

  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥30 用arduino开发esp32控制ps2手柄一直报错
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥20 求一个html代码,有偿