Creating Google calendar events from Gmail

2019-09-19 14:07发布

I like how my flight information directly pops up in my Google calendar (even if it's a bit scary) and I would like the same thing to happen when, e.g., I book train tickets. My first though was to make a Chrome extension which would parse my Gmail inbox for specifik strings and then create a calendar event if it found the right info.

But, when reading about the calendar API I realized that it would be more logical to use the Gmail API and get the data from the mail directly then to parse a web page for the information. Right?

Do you see any problems with this approach? Authorization, for example. And could I use my ordinary web server to store the code? (I'm a newbie when it comes to these things). Even better, could I store it on a personal Google Site?

tl;dr

Can I use Google's API:s to check my mails and create events if the mail contain the right data? And would there be any problems like authorization etc?

1条回答
手持菜刀,她持情操
2楼-- · 2019-09-19 14:50

You can use Gmail API to get users's emails and then parse those emails to generate Google Calendar Events using Google Calendar API. Your application will need to have access to both Gmail Emails and user's Calendar. Better, use Gmail Push notifications, so that you receive a notification as soon as an email gets dropped in your mailbox and then parse it to see, if you would like to create a calendar event for that email.

查看更多
登录 后发表回答