Google 日历与节点 js 应用实时同步

Google Calendar live sync with node js app

我想将 google 日历与我的应用程序同步。
当用户当时在 Google 日历中添加一些事件时,
我想在我的节点服务器响应中添加这些新事件

意味着与 google 日历实时同步。
我想要类似监听器的东西来监听新事件。

你可以检查这个Quickstart tutorial and node-google-calendar

如果您没有,则需要创建一个 service account。 public/private 密钥对是为服务帐户生成的,它是从 Google API 控制台创建的。记下服务帐户的电子邮件地址,并将服务帐户的 json 或 P12 私钥文件存储在您的应用程序可以访问的位置。您的应用程序需要他们进行授权 API 调用。如果用户想要向您的应用程序授予访问他的 Google 日历的权限,他必须使用 Google 日历设置下提供的电子邮件地址向创建的服务帐户授予每个日历的特定权限。

使用 Google 日历 API 您还可以 watch for changes to Events or CalendarList resources, see this and this. Basically you will need to create an endpoint on your server which will receive events/calendars update notifications. When notification arrives, request a calendars/events synchronization. To make the synchronization efficient, use incremental sync. Check this question 查看算法。