WojtekTB / UCSD-Schedule-Visualizer

Chrome extension that creates a timetable of your WebReg classes and shows you where the class you are hovering over would fit in your schedule.
MIT License
5 stars 3 forks source link

Make "add to google calendar" button #20

Open WojtekTB opened 2 years ago

WojtekTB commented 2 years ago

Would be nice to make a button that lets you create a google calendar with your classes as events there.

The api seems to make this trivial so just a matter of actually doing it.

https://developers.google.com/calendar/api/v3/reference/events/insert#javascript

Should definitely take care to put the events into a new, separate calendar.

WojtekTB commented 2 years ago

Actually, this turns out to be a little bit problematic due to requirements of api key or OAuth 2.0, neither of which is easy to do in an extension format.

I could obviously just put an api key into the code but then that seems a little dumb and dangerous. And I am not aware if there is a way to hide the api key for use in the chrome extensions?

This just leaves us with OAuth2. https://developer.chrome.com/docs/extensions/mv3/tut_oauth/ There is an example on how to make it work in the chrome extensions but it will require a lot of work. I think I will work on this later and will put this on the burner for now.