b83d814c7caa81f6a93e68b78d74df647e847b7b
Project
- Name:: Simple WebUntis → PocketBase sync
- Description:: A small Node.js script that fetches your WebUntis timetable and synchronizes classes into a PocketBase collection.
Files
- Main script:: index.js
- Package metadata:: package.json
- Dockerfile:: dockerfile
Requirements
- Node.js:: v14+ recommended
- Environment:: A PocketBase instance reachable from the script (the URL is currently set inside
index.js).
Dependencies
- webuntis: fetches timetable data
- pocketbase: PocketBase client
- luxon: date handling
- dotenv: load environment variables
Configuration
- Environment variables:: Create a
.envin the project root with at least:
WEBUNTIS_SCHOOL=your_school
WEBUNTIS_USER=your_username
WEBUNTIS_PASS=your_password
WEBUNTIS_URL=your_webuntis_url
- PocketBase URL:: The script currently instantiates PocketBase with a hard-coded URL (
https://fsae41.de). Editindex.jsto change this or make it configurable via an env var.
Install
npm install
Run
node index.js
The script runs an initial sync and then repeats every 30 minutes (see setInterval near the end of index.js).
Behavior
- Merging lessons:: The script sorts and merges adjacent lessons that end and start at the same time on the same day.
- PocketBase collection:: Records are created/updated in the
classescollection. Existing records are compared and updated if changes are detected.
Docker
- A
dockerfileis present; you can containerize the app. Ensure environment variables and PocketBase URL are provided to the container.
Notes & Next steps
- Consider moving the PocketBase URL into
.envfor easier configuration. - Add error handling and logging for production use.
License
- No license specified. Add one if you plan to publish.
Contact
- Questions or improvements: edit
index.jsand open an issue or PR in your repo.
Description
Languages
JavaScript
100%