Closed tphan25 closed 4 years ago
The project is now importable at github.com/tphan25/vttimetable.
timetableURL := "https://banweb.banner.vt.edu/ssb/prod/HZSKVTSC.P_ProcRequest"
cq := vttimetable.CreateEmptyQuery().SetCampus("0").SetCrn("828").SetTermYear("201909")
resp, err := vttimetable.SendQuery(timetableURL, cq)
if err != nil {
fmt.Println(err)
}
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println(err)
}
err = ioutil.WriteFile("foo.txt", body, 0644)
if err != nil {
fmt.Println(err)
}
courses, err := vttimetable.ReadInput(bytes.NewReader(body))
if err != nil {
fmt.Println(err)
}
for _, course := range courses {
fmt.Println(course)
}
A sample file, will probably create helper methods so that some users may not need to interact with all of the response data.
Transform this project so that it is importable by another project separately.