mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-08-02 17:59:14 +02:00
fix:#15 added time rule for fetching ws and ss
This commit is contained in:
@@ -64,16 +64,20 @@ func GetSeminarGroupsEventsFromHTML(seminarGroupsLabel []string) []model.Seminar
|
||||
var seminarGroups []model.SeminarGroup
|
||||
for _, seminarGroupLabel := range seminarGroupsLabel {
|
||||
|
||||
result, getError := getPlanHTML("ss", seminarGroupLabel)
|
||||
if getError == nil {
|
||||
seminarGroup := parseSeminarGroup(result)
|
||||
seminarGroups = append(seminarGroups, seminarGroup)
|
||||
if (time.Now().Month() >= 3) && (time.Now().Month() <= 10) {
|
||||
result, getError := getPlanHTML("ss", seminarGroupLabel)
|
||||
if getError == nil {
|
||||
seminarGroup := parseSeminarGroup(result)
|
||||
seminarGroups = append(seminarGroups, seminarGroup)
|
||||
}
|
||||
}
|
||||
|
||||
result, getError = getPlanHTML("ws", seminarGroupLabel)
|
||||
if getError == nil {
|
||||
seminarGroup := parseSeminarGroup(result)
|
||||
seminarGroups = append(seminarGroups, seminarGroup)
|
||||
if (time.Now().Month() >= 9) || (time.Now().Month() <= 4) {
|
||||
result, getError := getPlanHTML("ws", seminarGroupLabel)
|
||||
if getError == nil {
|
||||
seminarGroup := parseSeminarGroup(result)
|
||||
seminarGroups = append(seminarGroups, seminarGroup)
|
||||
}
|
||||
}
|
||||
}
|
||||
return seminarGroups
|
||||
|
Reference in New Issue
Block a user