This project is a web scraper for the Danish gymnasium site Lectio by MaCom A/S. With this, you are able to extract the schedule from the main site and have it sync with your Google Calendar.
Clone the repository to a desired location
$ git clone "https://github.com/mattismoel/go-lectio-scraper.git
Tidy the project
$ go mod tidy
To build the project binary for MacOS, Windows and Linux, run the following command:
$ make build
This exports the binaries to the bin
directory.
The project can be run either by the executable (with make run
or direct call on the executable in the bin
directory) or the go run
command. Generally, the executable will be faster.
Syncing Lectio schedule with Google Calendar with modules for the next three weeks:
$ lego sync -u username1234 -p password1234 -s 133 -c somecalendarid1234@group.calendar.google.com -w 3
Clearing all Lectio modules from Google Calendar
Note: This DOES NOT delete normal events from your calendar. Only Lectio modules are targeted.
$ lego clear -c somecalendarid1234@group.calendar.google.com
This project makes use of the Google Calendar API, and therefore needs you to log in with your Google Account. When the application is run for the first time, a link will appear for you to log in. Click this link and enter confirm that Lectigo can modify your Google Calendar. When confirmed the syncing process should start automagically.
The list of calendars that you own can be found at Google Calendar API's documentation CalendarList:list(). In the sidebar, you should see an Execute
button. The resulting JSON is a list of your Google calendars. Find the desired calendar, copy the value of "id"
and paste it into the googleSecrets.json
file. Everything should be ready to go.