我可以使用 Google 日历数据 API 输入的事件有限制吗?

发布于 2024-08-20 23:48:15 字数 1423 浏览 4 评论 0原文

我运行一个 php 脚本来插入从 CSV 文件中获取的事件。这些事件已成功输入我的日历,但在输入大约 75 个事件后它停止了。不知道它是否仅限于一定数量的事件,或者是我的代码中的问题。

预先感谢您对我的帮助!

  $event->title = $service->newTitle($title);

  $event->where = array($service->newWhere("Red Ball Internet Centre"));


  $service->newContent($content);



  // Set the date using RFC 3339 format.

  $tzOffset = "-04";



  $when = $service->newWhen();

  $when->startTime = "{$startDate}T{$startTime}:00.000{$tzOffset}:00";

  $when->endTime = "{$endDate}T{$endTime}:00.000{$tzOffset}:00";

  $event->when = array($when);

  // Upload the event to the calendar server

  // A copy of the event as it is recorded on the server is returned
  switch($rink)
  {
    case"Rink A":
        $uri = "http://www.google.com/calendar/feeds/qsqivvbvdm7o4ibrmt9gfu301g%40group.calendar.google.com/private/full"; 
    break;
    case"Rink B":
        $uri = "http://www.google.com/calendar/feeds/dcr864c3orqj264mufl1t3slt8%40group.calendar.google.com/private/full"; 
    break;
    case"Rink C":
        $uri = "http://www.google.com/calendar/feeds/bira8i123uuqovhn5kuk9caqnk%40group.calendar.google.com/private/full"; 
    break;
    case"Rink D":
        $uri = "http://www.google.com/calendar/feeds/11a8m100ccjhms971kc33app4g%40group.calendar.google.com/private/full"; 
    break;                  
  }

  $newEvent = $service->insertEvent($event, $uri);

I' running a php script to insert events that I take from a CSV file. The events are entering successfully in my calendar, but it stops after about 75 events entered. Any idea if it's limited to a certain amount of events or it's a problem in my code.

Thanks in advance for helping me!

  $event->title = $service->newTitle($title);

  $event->where = array($service->newWhere("Red Ball Internet Centre"));


  $service->newContent($content);



  // Set the date using RFC 3339 format.

  $tzOffset = "-04";



  $when = $service->newWhen();

  $when->startTime = "{$startDate}T{$startTime}:00.000{$tzOffset}:00";

  $when->endTime = "{$endDate}T{$endTime}:00.000{$tzOffset}:00";

  $event->when = array($when);

  // Upload the event to the calendar server

  // A copy of the event as it is recorded on the server is returned
  switch($rink)
  {
    case"Rink A":
        $uri = "http://www.google.com/calendar/feeds/qsqivvbvdm7o4ibrmt9gfu301g%40group.calendar.google.com/private/full"; 
    break;
    case"Rink B":
        $uri = "http://www.google.com/calendar/feeds/dcr864c3orqj264mufl1t3slt8%40group.calendar.google.com/private/full"; 
    break;
    case"Rink C":
        $uri = "http://www.google.com/calendar/feeds/bira8i123uuqovhn5kuk9caqnk%40group.calendar.google.com/private/full"; 
    break;
    case"Rink D":
        $uri = "http://www.google.com/calendar/feeds/11a8m100ccjhms971kc33app4g%40group.calendar.google.com/private/full"; 
    break;                  
  }

  $newEvent = $service->insertEvent($event, $uri);

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

黯淡〆 2024-08-27 23:48:15

该脚本在停止之前大约运行了多长时间?您是否需要增加 php.ini 文件中的 MAX_EXECUTION_TIME 设置? PHP 有可能在有机会完成之前就超时了。

Roughly how long is this script running before it stops? Could it be that you need to increase the MAX_EXECUTION_TIME setting in your php.ini file? It's possible that PHP is timing out before it has a chance to complete.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文