-
Notifications
You must be signed in to change notification settings - Fork 2
/
allfood.go
40 lines (31 loc) · 858 Bytes
/
allfood.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
package main
import (
"flag"
)
func main() {
a := App{}
radius := flag.Int("radius", 0, "Radius")
lat := flag.String("lat", "", "Latitude")
lng := flag.String("lng", "", "Longitute")
gKey := flag.String("google-key", "", "Google Api Key")
fbID := flag.String("fb-app-id", "", "Facebook APP ID")
fbSecret := flag.String("fb-app-secret", "", "Facebook APP Secret")
fsID := flag.String("fs-app-id", "", "FourSquare APP ID")
fsSecret := flag.String("fs-app-secret", "", "FourSquare APP Secret")
flag.Parse()
a.Initialize(*radius, *lat, *lng)
if *gKey != "" {
google := NewGoogle(*gKey)
a.AddProvider(google)
}
if *fbID != "" && *fbSecret != "" {
fb := NewFacebook(*fbID, *fbSecret)
fb.GetToken()
a.AddProvider(fb)
}
if *fsID != "" && *fsSecret != "" {
fs := NewFourSquare(*fsID, *fsSecret)
a.AddProvider(fs)
}
a.Run()
}