如何使用 JavaScript 从 Google Calendar (API) 获取今天的事件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10572237/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 10:18:48  来源:igfitidea点击:

How to get today's events from Google Calendar (API) using JavaScript?

javascriptgoogle-calendar-apigoogle-api-client

提问by Yeseanul

I'm new to Google Calendar APIs and what I'm trying to do is to display today's events from a public Google Calendar using JavaScript.

我是 Google 日历 API 的新手,我想要做的是使用 JavaScript 从公共 Google 日历显示今天的事件。

I've found this resource(dead link), but I can't figure it out how to modify it so that it will output only today's events.

我找到了这个资源(死链接),但我不知道如何修改它以便它只输出今天的事件。

Any help will be appreciated.

任何帮助将不胜感激。

采纳答案by Kvam

Take a look at the API: https://developers.google.com/calendar/quickstart/apps-script

看一下 API:https: //developers.google.com/calendar/quickstart/apps-script

You can set the start-min and start-max parameters.

您可以设置 start-min 和 start-max 参数。

回答by ram

AuthSub proxy authentication is used by web applications which need to authenticate their users to Google accounts. The website operator does not need access to the username and password for the calendar user - only special AuthSub tokens are required. Please see the AuthSub documentation for more detailed information.

AuthSub 代理身份验证由需要向 Google 帐户验证其用户的 Web 应用程序使用。网站运营商不需要访问日历用户的用户名和密码 - 只需要特殊的 AuthSub 令牌。有关更多详细信息,请参阅 AuthSub 文档。

When a user first visits your application, they have not yet been authenticated. In this case, you need to print some text and a link directing the user to Google to authenticate your request for access to their calendar. The Python Google Data API client library provides a function to generate this URL from the CalendarService class. The code below sets up a link to the AuthSubRequest page.

当用户第一次访问您的应用程序时,他们尚未通过身份验证。在这种情况下,您需要打印一些文本和一个链接,将用户引导至 Google 以验证您访问其日历的请求。Python Google Data API 客户端库提供了从 CalendarService 类生成此 URL 的函数。下面的代码设置到 AuthSubRequest 页面的链接。