59 lines
1,008 B
Go
59 lines
1,008 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
goskola24api "git.zervo.org/zervo/GoSkola24API"
|
|
"git.zervo.org/zervo/GoSkola24API/internal/utility"
|
|
)
|
|
|
|
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.Name)
|
|
if school.AvailableData.HasCourses {
|
|
fmt.Println("School has data")
|
|
}
|
|
}
|
|
|
|
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)
|
|
}
|
|
|
|
classes, err := api.GetClasses(schools[4], true)
|
|
if err != nil {
|
|
fmt.Println(err.Error())
|
|
}
|
|
|
|
for _, class := range classes {
|
|
fmt.Println(class.Name)
|
|
}
|
|
|
|
fmt.Println(key)
|
|
}
|