对于我的项目,我试图从用户的谷歌日历中提取航班预订信息。
我需要的关键信息是
航班确认号
,存储在
描述
事件的。
calendar preview
这是来自
事件:获取
"kind": "calendar#event",
"etag": "\"3043267198652000\"",
"id": "_6tlnaq...o6e",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=XzZ0...QG0",
"created": "2018-03-07T00:12:22.000Z",
"updated": "2018-04-04T23:47:36.112Z",
"summary": "Flight to Sydney (PX 1)",
"description": "To see detailed information for automatically created events like this one, use the official Google Calendar app. https://g.co/calendar",
"location": "Port Moresby POM",
"creator": {
"email": "inceptable@gmail.com",
"self": true
},
"organizer": {
"email": "unknownorganizer@calendar.google.com"
},
"start": {
"dateTime": "2018-04-21T15:00:00+10:00"
},
"end": {
"dateTime": "2018-04-21T18:55:00+10:00"
}
此事件的描述已替换为以下消息:
"To see detailed information for automatically created events like this one, use the official Google Calendar app. https://g.co/calendar"
我找不到任何关于为什么会发生这种情况的信息。
Forum post with same problem
我的解决方法是使用
Gmail API
读取用户的电子邮件,并用正则表达式提取航班确认号。
这是不可取的,因为它容易出错,并且需要用户的许可才能阅读他们的电子邮件。
我宁愿让谷歌提取这些信息,因为他们已经在这么做了。
是否可以从自动创建的事件中访问此信息?
如果没有,谷歌为什么要限制这些信息?