简体   繁体   English

OAuth + Google日历+ Python

[英]OAuth + Google Calendar + Python

I'm stuck.. 我被卡住了。

Basically my goal is I want to be able to pull in end user's calendars, and parse their data daily. 基本上,我的目标是我希望能够提取最终用户的日历,并每天解析其数据。 I don't need any interaction from them, just enough to authenticate them with OAuth. 我不需要它们的任何交互,只需要使用OAuth对其进行身份验证即可。 My current solution is a plain text file that it goes through as a dictionary and pulls in the calendar that way, but that's just asking for trouble. 我当前的解决方案是将纯文本文件作为字典进行处理,并以这种方式获取日历,但这只是自找麻烦。 I am just getting my hands on OAuth but don't know how I'd use it in my instance. 我只是接触OAuth,但是不知道如何在实例中使用它。

Take a look at this example for using OAuth2 to access Google Cloud Storage. 看一下使用OAuth2访问Google Cloud Storage的示例 You should be able to use it with relatively small tweaks to pull Google Calendar data (primarily changing the scope from https://www.googleapis.com/auth/devstorage.full_control to https://www.googleapis.com/auth/calendar 您应该可以通过较小的调整就可以使用它来提取Google日历数据(主要是将范围从https://www.googleapis.com/auth/devstorage.full_control更改为https://www.googleapis.com/auth/calendar

This example is also helpful, showing how to loop over all a user's Google+ activities and print them to the console. 这个例子也很有帮助,展示了如何遍历用户的所有Google+活动并将其打印到控制台。 Especially take note of how to use from apiclient.discovery import build to build an API object to interacte with the service. 尤其要注意如何使用from apiclient.discovery import build来构建与服务进行交互的API对象。

You can also play with the Google Calendar API using the OAuth 2.0 playground tool or look through the API using the APIs explorer . 您也可以使用OAuth 2.0游乐场工具使用Google Calendar API或使用API Explorer浏览API

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM