GoSkola24API/cmd/goskola24api/main.go

41 lines
632 B
Go
Raw Normal View History

2024-11-21 18:41:28 +01:00
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())
}
fmt.Println(rooms)
for _, room := range rooms {
fmt.Println(room.Name)
}
fmt.Println(key)
}