mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-07-25 13:59:14 +02:00
fix:#68 course insert update fetcher
This commit is contained in:
@@ -69,7 +69,7 @@ func FetchAndParse(season, label string) (model.SeminarGroup, error) {
|
||||
if err != nil {
|
||||
return model.SeminarGroup{}, err
|
||||
}
|
||||
return parseSeminarGroup(result), nil
|
||||
return parseSeminarGroup(result, season), nil
|
||||
}
|
||||
|
||||
func SplitEventType(events []model.Event) ([]model.Event, error) {
|
||||
@@ -90,7 +90,7 @@ func SplitEventType(events []model.Event) ([]model.Event, error) {
|
||||
return events, nil
|
||||
}
|
||||
|
||||
func parseSeminarGroup(result string) model.SeminarGroup {
|
||||
func parseSeminarGroup(result string, semester string) model.SeminarGroup {
|
||||
doc, err := html.Parse(strings.NewReader(result))
|
||||
if err != nil {
|
||||
fmt.Printf("Error occurred while parsing the HTML document: %s\n", err.Error())
|
||||
@@ -134,6 +134,7 @@ func parseSeminarGroup(result string) model.SeminarGroup {
|
||||
University: findFirstSpanWithClass(table, "header-1-0-0").FirstChild.Data,
|
||||
Course: course,
|
||||
Events: events,
|
||||
Semester: semester,
|
||||
}
|
||||
return seminarGroup
|
||||
}
|
||||
|
Reference in New Issue
Block a user