This repository has been archived by the owner on Sep 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
78 lines (73 loc) · 1.68 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package main
import (
"log"
"os"
"github.com/loganprice/vaccine-alert/cmd"
"github.com/urfave/cli/v2"
)
func main() {
app := &cli.App{
Name: "Covid Alert",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "zip-code",
Usage: "Zip Code to be searched",
EnvVars: []string{"ZIPCODE", "ZIP"},
Required: true,
},
&cli.IntFlag{
Name: "max-distance",
Value: 25,
Usage: "Distance from Zip Code to search",
EnvVars: []string{"DISTANCE"},
},
&cli.StringFlag{
Name: "zip-key",
Usage: "API Key for https://www.zipcodeapi.com/",
EnvVars: []string{"ZIP_KEY"},
Required: true,
},
&cli.StringFlag{
Name: "ifttt-key",
Usage: "API Key for https://ifttt.com/",
EnvVars: []string{"IFTTT_KEY"},
Required: true,
},
&cli.StringFlag{
Name: "ifttt-event",
Usage: "Event ID for https://ifttt.com/ webhook",
EnvVars: []string{"IFTTT_KEY"},
Required: true,
},
&cli.BoolFlag{
Name: "jj-allowed",
Usage: "Show alerts for Johnson and Johnson Vaccinne",
EnvVars: []string{"JJ"},
Value: true,
},
&cli.BoolFlag{
Name: "pfizer-allowed",
Usage: "Show alerts for Pfizer Vaccinne",
EnvVars: []string{"PFIZER"},
Value: true,
},
&cli.BoolFlag{
Name: "moderna-allowed",
Usage: "Show alerts for Moderna Vaccinne",
EnvVars: []string{"MODERNA"},
Value: true,
},
&cli.IntFlag{
Name: "interval",
Usage: "Interval in seconds to to check for appointments",
EnvVars: []string{"INTERVAL"},
Value: 15,
},
},
Action: cmd.Run,
}
err := app.Run(os.Args)
if err != nil {
log.Fatal(err)
}
}