exad is an EXam ADministration
It is built for the HTBLA Leonding, but should also work with other schools. It scrapes exams from WebUntis, parses their information and can store them in a .csv
file (which can be imported to Google Calendar) or directly push them to Google Calendar (for that, Google API and Google OAuth 2.0 must be set up).
.NET 8 or higher
- Download the source code
- Unzip the folder
- When running
dotnet run
for the first time, the config file is automatically generated in~/.config/exad/config.json
- In the
config.json
configure the following:calendar-id
(optional): The ID of the Google Calendar to push the exams to (I recommend creating a new calendar, so the program doesn't have to mess with your personal calendar)schoolurl
: The URL which WebUnits uses for the school (to get it, go to your school's WebUntis page and copy the domain, e.g.:mese.webuntis.com
)schoolname
: The name which WebUnits uses for the school (to get it, go to your school's WebUntis page and copy the name from the top-left corner, e.g.:HTBLA Linz-Leonding
)username
: The username of the WebUntis accountpassword
: The password of the WebUntis account
- (optional) Setup the Google API:
- Go to the Google API Console and create a new project - top left: Select a project > New project. Then, name your project and click create
- Now, go to the Library tab in the side bar and search for "Google Calendar". Click on the Google Calendar API card and click Enable
- After that, click on Credentials tab under the "Google Calendar API" and then Configure Consent Screen
- Select External as the user type. Then fill out the required fields (should only be "App Information" and "Developer Contact Information"). As the app name, you can choose whatever you want and as the email you can choose your normal email (we won't be publishing this project anyway so the contact information isn't important). After that, click Save and continue
- Under Scopes, select Add or remove scopes and type filter for "auth/calendar.events" and select the scopes auth/calendar.events and auth/calendar.events.owned that appear. Then, click Update and Save and continue
- Under "Test users", add yourself as the test user (the email you enter will later be used to log into the consent screen), then click Save and continue
- At the end you can review your information and then click Back to dashboard
- Lastly, on go to the Credentials tab in the side bar and click Create credentials. Select OAuth client ID. Select Desktop app as the application type, give it a name and click Create. A new window will open, showing you the client ID and client secret. Download the JSON file and save at this path in your home directory
~/.exad/client_secrets.json
- (optional) Setup a subjects-translator: In the
Classes.cs
there is a method calledTranslateSubject()
which translates the raw subject names from Webuntis any subject names you want. You can change the method to your liking. If you don't want to translate any subjects, just leave the method as it is.
Run dotnet run -- --help
to see the help page
dotnet run -- save -o <output-file>.csv
to save the exams to a.csv
file (default for output-file isevents.csv
)dotnet run -- push
to push the exams to the Google Calendar