GoSkola24API/cmd/goskola24api/main.go
2024-12-06 21:43:57 +01:00

54 lines
907 B
Go

package main
import (
"fmt"
"git.zervo.org/zervo/GoSkola24API/internal/utility"
"git.zervo.org/zervo/GoSkola24API/pkg/goskola24api"
)
func main() {
key, _ := utility.GetRendererKey()
api := goskola24api.Skola24API{
Host: "avesta.skola24.se",
}
_, err := api.GetTerms()
if err != nil {
fmt.Println(err.Error())
}
schools, _ := api.GetSchools()
for _, school := range schools {
fmt.Println(school.AvailableData)
}
rooms, err := api.GetRooms(schools[4], true)
if err != nil {
fmt.Println(err.Error())
}
for _, room := range rooms {
fmt.Println(room.Name)
}
teachers, err := api.GetTeachers(schools[4], true)
if err != nil {
fmt.Println(err.Error())
}
for _, teacher := range teachers {
fmt.Println(teacher.FullName)
}
students, err := api.GetStudents(schools[4], true)
if err != nil {
fmt.Println(err.Error())
}
fmt.Println(students)
fmt.Println(key)
}