forked from abhishekkr/twt
/
twt.go
36 lines (27 loc) · 759 Bytes
/
twt.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
package main
import (
"flag"
"fmt"
golconfig "github.com/abhishekkr/gol/golconfig"
golhashmap "github.com/abhishekkr/gol/golhashmap"
twt "github.com/abhishekkr/twt/bird"
)
var (
config = flag.String("config", "", "config json file for API Keys")
)
func panic_for_config(creds golhashmap.HashMap) {
if creds["api-key"] == "" || creds["api-secret"] == "" ||
creds["access-token"] == "" || creds["access-token-secret"] == "" {
panic("Config doesn't have all credentials required.")
}
}
func main() {
var creds golhashmap.HashMap
flag.Parse()
creds = make(golhashmap.HashMap)
json := golconfig.GetConfig("json")
json.ConfigFromFile(*config, &creds)
panic_for_config(creds)
fmt.Println("starting stalking")
twt.StalkFollowers(creds)
}