Full classlist, multiple days
This commit is contained in:
130
main.go
130
main.go
@@ -12,17 +12,126 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var calName = flag.String("calendar", "", "name of calendar")
|
var calName = flag.String("calendar", "", "name of calendar")
|
||||||
|
var days = flag.Int("days", 0, "number of days in the future")
|
||||||
|
|
||||||
var students = []string{
|
var allStudents = []string{
|
||||||
"oliver.park@heliosns.org",
|
"oliver.park@heliosns.org",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var greenStudents = []string{
|
||||||
|
"oliver.park@heliosns.org",
|
||||||
|
}
|
||||||
|
|
||||||
|
var weekDays = []time.Weekday{time.Monday, time.Tuesday, time.Wednesday, time.Thursday, time.Friday}
|
||||||
|
var weekDaysButFriday = []time.Weekday{time.Monday, time.Tuesday, time.Wednesday, time.Thursday}
|
||||||
|
|
||||||
var classes = []Class {
|
var classes = []Class {
|
||||||
Class{
|
Class{
|
||||||
Summary: "Test 2",
|
Summary: "Morning Circle",
|
||||||
Start: "22:00",
|
Start: "08:30",
|
||||||
End: "22:30",
|
End: "09:00",
|
||||||
Days: []time.Weekday{time.Monday, time.Tuesday, time.Wednesday, time.Thursday},
|
Days: weekDaysButFriday,
|
||||||
|
Zoom: "https://us02web.zoom.us/j/2274643506?pwd=Nm5NUXMwOVJKbEUzNE5VSkZCQzJ2UT09",
|
||||||
|
},
|
||||||
|
Class{
|
||||||
|
Summary: "Community Meeting",
|
||||||
|
Start: "08:30",
|
||||||
|
End: "09:00",
|
||||||
|
Days: []time.Weekday{time.Friday},
|
||||||
|
Zoom: "https://zoom.us/j/96371462107",
|
||||||
|
},
|
||||||
|
Class{
|
||||||
|
Summary: "Math (Claudia & Rachel)",
|
||||||
|
Start: "09:00",
|
||||||
|
End: "09:40",
|
||||||
|
Days: weekDays,
|
||||||
|
Zoom: "https://us02web.zoom.us/j/2274643506?pwd=Nm5NUXMwOVJKbEUzNE5VSkZCQzJ2UT09",
|
||||||
|
Students: []string{
|
||||||
|
"oliver.park@heliosns.org",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Class{
|
||||||
|
Summary: "Dreambox",
|
||||||
|
Start: "09:40",
|
||||||
|
End: "10:00",
|
||||||
|
Days: weekDays,
|
||||||
|
},
|
||||||
|
Class{
|
||||||
|
Summary: "Theme",
|
||||||
|
Start: "10:30",
|
||||||
|
End: "11:30",
|
||||||
|
Days: weekDaysButFriday,
|
||||||
|
Zoom: "https://us02web.zoom.us/j/2274643506?pwd=Nm5NUXMwOVJKbEUzNE5VSkZCQzJ2UT09",
|
||||||
|
},
|
||||||
|
Class{
|
||||||
|
Summary: "SEL",
|
||||||
|
Start: "10:30",
|
||||||
|
End: "11:15",
|
||||||
|
Days: []time.Weekday{time.Friday},
|
||||||
|
Zoom: "https://us02web.zoom.us/j/2274643506?pwd=Nm5NUXMwOVJKbEUzNE5VSkZCQzJ2UT09",
|
||||||
|
},
|
||||||
|
Class{
|
||||||
|
Summary: "Literacy (Green)",
|
||||||
|
Start: "11:30",
|
||||||
|
End: "12:00",
|
||||||
|
Days: []time.Weekday{time.Monday, time.Wednesday},
|
||||||
|
Zoom: "https://us02web.zoom.us/j/2274643506?pwd=Nm5NUXMwOVJKbEUzNE5VSkZCQzJ2UT09",
|
||||||
|
Students: greenStudents,
|
||||||
|
},
|
||||||
|
Class{
|
||||||
|
Summary: "PE (Yellow/Green)",
|
||||||
|
Start: "11:30",
|
||||||
|
End: "12:00",
|
||||||
|
Days: []time.Weekday{time.Tuesday},
|
||||||
|
Zoom: "https://zoom.us/j/97472507748?pwd=cW5vUFhyUjNTS2toWlZGN254U1ZqZz09",
|
||||||
|
Students: greenStudents,
|
||||||
|
},
|
||||||
|
Class{
|
||||||
|
Summary: "iLab (Yellow/Green)",
|
||||||
|
Start: "11:30",
|
||||||
|
End: "12:00",
|
||||||
|
Days: []time.Weekday{time.Thursday},
|
||||||
|
Zoom: "https://us02web.zoom.us/j/86403635026?pwd=S2t1WkN2dnNJZlFkejdEbjRsUmNNUT09",
|
||||||
|
Students: greenStudents,
|
||||||
|
},
|
||||||
|
Class{
|
||||||
|
Summary: "Library",
|
||||||
|
Start: "11:30",
|
||||||
|
End: "12:00",
|
||||||
|
Days: []time.Weekday{time.Friday},
|
||||||
|
Zoom: "https://us02web.zoom.us/my/helioslibrary?pwd=cWd4RjNqNXZXNjRjM2dYQVhYeS9Xdz09",
|
||||||
|
},
|
||||||
|
Class{
|
||||||
|
Summary: "Spanish",
|
||||||
|
Start: "12:45",
|
||||||
|
End: "13:30",
|
||||||
|
Days: []time.Weekday{time.Monday, time.Tuesday, time.Wednesday},
|
||||||
|
Zoom: "https://zoom.us/j/95144364579?pwd=cGdwNTZIOE42Y0syeVcwVEFhZ1JxZz09",
|
||||||
|
Students: []string{
|
||||||
|
"oliver.park@heliosns.org",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Class{
|
||||||
|
Summary: "Music & Movement (Blue/Green)",
|
||||||
|
Start: "12:45",
|
||||||
|
End: "13:30",
|
||||||
|
Days: []time.Weekday{time.Friday},
|
||||||
|
Zoom: "https://zoom.us/j/96449009866?pwd=dlBHYUwxaDRReFhjVmRKZ0Vhdjdkdz09",
|
||||||
|
Students: greenStudents,
|
||||||
|
},
|
||||||
|
Class{
|
||||||
|
Summary: "Art (Blue/Green)",
|
||||||
|
Start: "14:00",
|
||||||
|
End: "14:45",
|
||||||
|
Days: []time.Weekday{time.Friday},
|
||||||
|
Zoom: "https://us02web.zoom.us/j/85434303018?pwd=c3EzQVNCMmk0L0o4bVF4QW85RTZHZz09",
|
||||||
|
Students: greenStudents,
|
||||||
|
},
|
||||||
|
Class{
|
||||||
|
Summary: "Closing Circle",
|
||||||
|
Start: "15:00",
|
||||||
|
End: "15:15",
|
||||||
|
Days: []time.Weekday{time.Friday},
|
||||||
Zoom: "https://us02web.zoom.us/j/2274643506?pwd=Nm5NUXMwOVJKbEUzNE5VSkZCQzJ2UT09",
|
Zoom: "https://us02web.zoom.us/j/2274643506?pwd=Nm5NUXMwOVJKbEUzNE5VSkZCQzJ2UT09",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -81,14 +190,14 @@ func main() {
|
|||||||
|
|
||||||
now := time.Now().In(loc)
|
now := time.Now().In(loc)
|
||||||
|
|
||||||
dateStr := now.Format("2006-01-02")
|
for i := 0; i < *days; i++ {
|
||||||
|
date := now.Add(time.Duration(i * 24) * time.Hour)
|
||||||
// TOOD: loop through days
|
dateStr := date.Format("2006-01-02")
|
||||||
|
|
||||||
for _, class := range classes {
|
for _, class := range classes {
|
||||||
found := false
|
found := false
|
||||||
for _, day := range class.Days {
|
for _, day := range class.Days {
|
||||||
if day == now.Weekday() {
|
if day == date.Weekday() {
|
||||||
found = true
|
found = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@@ -112,7 +221,7 @@ func main() {
|
|||||||
|
|
||||||
attendees := class.Students
|
attendees := class.Students
|
||||||
if len(attendees) == 0 {
|
if len(attendees) == 0 {
|
||||||
attendees = students
|
attendees = allStudents
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, student := range attendees {
|
for _, student := range attendees {
|
||||||
@@ -133,6 +242,7 @@ func main() {
|
|||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user