Categorygithub.com/Stroby241/UntisAPI
modulepackage
0.0.0-20220813183158-18ce2ba9b7d9
Repository: https://github.com/stroby241/untisapi.git
Documentation: pkg.go.dev

# README

UnitsAPI

This project Provides a Golang wrapper for the WebUntis API. This Repo is still a work in progress. Therefore not all API features are avaliable.

Attention This Codebase is no longer maintained and could break over time. If you sumble upon this because you too want to access the horrible WebUntis API and are failing completely. Feel free to Email me. :) [email protected]

Features

  • Login / Logout
  • Get all Rooms, Teachers and Subjects.
  • Get teacher or student id from name.
  • Get Timetable for specifig room.
  • Get the current schoolyear.
  • Get all schoolyears.

How to install:

Run the go get command:

go get github.com/Stroby241/UnitsAPI

and then import it into your go project:

import "github.com/Stroby241/UntisAPI"

How to use:

First login with your Untis user.

user := UntisAPI.NewUser([username], [password], [schoolname], [domain])
user.Login()
input fielddescibtion
[username]your Units username.
[password]your Units password.
[schoolname]The name of your school. The name must be exactly the same as in WebUntis.
[domain]The domain of your schools WebUntis.

To find the schoolname and domian. Go to https://webuntis.com/
Then select your school. Then you should be forwarded to a web site like this:

https://tipo.webuntis.com/WebUntis/?school=TBZ+Mitte+Bremen#/basic/login

In this example the domain is:

https://tipo.webuntis.com/

and the schoolname is:

TBZ Mitte Bremen

When your done with your Untis requests please logout.

user.Logout()

To get the current time and date in Untis time format do this:

untisDate := UntisAPI.ToUntisDate(time.Now())
untisTime := UntisAPI.ToUntisTime(time.Now())

To convert it back do this:

goDate := UnitsAPI.ToGoDate(untisDate)
goTime := UnitsAPI.ToGoTime(untisTime)

# Functions

NewUser returns a user based on the Login Credentials given which is necessary to use use the untisAPI */.
ToGoDate takes a time in the Untis way (yyyymmdd) and returns the a time.Time.
ToGoTime takes a time in the Untis way (hhmm) and returns the a time.Time.
ToUnitsTime takes a time.Time and returns the time formatted in the Untis way (hhmm).
ToUntisDate takes a time.Time and returns the Date formatted in the Untis way (yyyymmdd).

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author