-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
53 lines (47 loc) · 1.13 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package main
import (
"github.com/aws/aws-lambda-go/lambda"
"github.com/jaydp17/cultfit-class-booker/cultfit"
"github.com/jaydp17/cultfit-class-booker/logger"
)
const swimmingHSRCenterID = 172
const swimmingKoramangalaCenterID = 164
func Handler() {
log := logger.New()
log.Info("starting handler")
cookie := getCultCookie()
apiKey := getCultAPIKey()
preferences := []cultfit.SlotPreference{
{
CenterID: swimmingKoramangalaCenterID,
Time: "17:00:00", // 5pm
WorkoutName: "LEARN TO SWIM",
},
{
CenterID: swimmingKoramangalaCenterID,
Time: "17:30:00", // 5:30pm
WorkoutName: "LEARN TO SWIM",
},
{
CenterID: swimmingKoramangalaCenterID,
Time: "18:00:00", // 6pm
WorkoutName: "LEARN TO SWIM",
},
{
CenterID: swimmingHSRCenterID,
Time: "17:00:00", // 5pm
WorkoutName: "LEARN TO SWIM",
},
{
CenterID: swimmingHSRCenterID,
Time: "17:30:00", // 5:30pm
WorkoutName: "LEARN TO SWIM",
},
}
cultProvider := cultfit.New()
cultProvider.AutoBook(preferences, cookie, apiKey)
log.Info("done!")
}
func main() {
lambda.Start(Handler)
}