41 lines
632 B
Go
41 lines
632 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())
|
||
|
}
|
||
|
|
||
|
fmt.Println(rooms)
|
||
|
|
||
|
for _, room := range rooms {
|
||
|
fmt.Println(room.Name)
|
||
|
}
|
||
|
|
||
|
fmt.Println(key)
|
||
|
}
|