A simple Google Apps Script that automatically fetches events from York University's eclass and sends notifications to a Discord channel.
Setup
- Import eclass calendar:
- Log into eclass and go to export calendar section
- Choose
Events related to courses
and choose theCustom time range
options - Click on export the calendar link
- Go to Google Calendar and select "Settings"
- Click on
Add calendars
and choosefrom URL
option - Pasted the above eclass calendar link to google calendar
- Get calendar ID:
- In Google Calendar
- Find your Eclass calendar
- Click ⋮ (three dots) → "Settings and sharing"
- Find "Calendar ID" under "Integrate calendar"
- Configure Google Apps Script
- Open your Google Apps Script project
- Go to Project Settings (⚙️)
- Click on "Script Properties"
- Add the following properties:
Key: WEBHOOKS | Value: Your discord webhook URL(s)
Key: CALENDAR | Value: Your calendar ID
- Set up automation
- Go to
Triggers
section of your GAS projects and choose functionsend2Discord
to automate - Select
Time-driven
in the "Select event source" section - Select
Day-timer
in the "Select type of time based trigger" - Pick appropriate time for the script to run in the
Select time of day
section