04 Jun 2025

Canvas Calendar

Another day automating my life as a CS student

Don’t want to read my yapping? Just access the GitHub repository here

Background

Being the typical overcommitted university student, I love to keep my events organized in Google Calendar. Our university uses Canvas which conveniently has a calendar feature too. We can even sync this up by importing the .ics file URL into Google Calendar, providing up-to-date information regarding assignment deadlines, lectures and more on our personal calendars.

Clicking the Calendar Feed button on Canvas

As great as that sounds, I’m sure you have also suffered from excessive Canvas announcements. Likewise, if you tried to import the .ics file before, you would realize that your calendar becomes a huge mess. You may not want to attend some optional consultation, or maybe there’s a class that has recorded lectures that you do not wish to attend. It quickly becomes too cluttered, messy and distracts you from the rest of your calendar.

Is there no API?

Canvas provides an API to access course data. However, like many institutions, NUS restricts access to the API, enabling it only for instructors or lecturers. So I could only turn to what was available to all students - the .ics feed.

This project was born out of the need to filter and sync that feed into my Google Calendar — automatically, and without manually maintaining two calendars.

What does the script do?

This Google Apps Script fetches your Canvas .ics feed, filters out unhelpful events using simple regular expressions (regex), and syncs the clean set into a separate Google Calendar. It updates regularly on a cron job (time trigger) and even removes events that no longer exist on Canvas.

You define what should be excluded — for instance, I removed anything that matched /CS2107/ which was a course I was teaching.

How to Use it

You can find more detailed instructions on the GitHub repository, and here’s a high level overview:

  1. Go to your institution’s Canvas portal and get the ICS link
  2. Setup a new Google Calendar and retrieve the ID
  3. Input these 2 data into your copy of the Google App Script (Found from the GitHub)
  4. Adjust your filter patterns in the script
  5. Schedule the script to run regularly

Tiny bonus: You can fix things when the code fails by running the deleteAllCalendarEvents function from the Google App Script directly

Final Notes

This project wasn’t about writing the most elegant .ics calendar parser -it was about solving a very specific problem in a simple, reliable way: I needed a calendar that showed only what I care without having to do manual work. It’s a small script that helps keep my academic life sane.

If you’re in a similar situation and want to clean up your Canvas calendar feel free to adapt or extend this script.

GitHub repository