A Google Apps Script for Google Calendar to create separate course calendars from the Canvas LMS calendar feed.
-
Make sure you've subscribed to your calendar already (See: How do I subscribe to the Calendar feed using Google Calendar as an instructor?)
-
Make a copy of the script for yourself: CanvasCalendarFilter - Google Apps Script
-
Find the section that says "BEGIN CONFIGURATION"
-
canvasCalendarIDis Google Calendar's unique ID for your Canvas Calendar -
Click the dropdown arrow next to your calendar in the Google Calendar left sidebar
-
Click "Calendar Settings"
-
Find the section labeled "Integrate calendar" and find "Calendar ID"
-
Paste it between the quotes on the line that says:
var canvasCalendarId = "";
-
-
courseListis a list of the courses that you want to make calendars for. This should match the name of the course in your calendar feed. (ie. if an event is called "Lesson 1.1 [Algebra I]", then you should put "Algebra I" in the list.- Make sure they match the example (quotes and commas!)
var courseList = ["English 9", "Social Studies 9", "Algebra I"];
- After finishing the setup, you should manually run the script by selecting "updateCalendarsForCourses" and clicking the play button at the top of Google Apps Script to initially sync all of the calendars.
- This will manually create separate calendars for each of the courses you named in courseList, but won't keep them updated.
- You can create what's called a "trigger" to have Google Apps Script automatically run the script on a schedule.
- We're going to create a "Manual trigger" to run the sync every 12 hours.
- Switch to the "TriggerManager.gs" in the left sidebar.
- Select
installTriggersand click the play button at the top: - If you'd like to tweak the trigger to run on a different schedule, read more at: Installable Triggers | Apps Script | Google Developers
- You should still run the sync manually at least once before waiting on the trigger to kick in! (See above.)
- Go back to TriggerManager.gs and select
deleteTriggersfrom the list of commands (just like when you installed the trigger). - Alternatively, delete the whole script file from the File menu!