-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmain.go
59 lines (49 loc) · 1.32 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
package main
import (
"flag"
"fmt"
g "github.com/daffainfo/apiguesser/apiguess"
)
var (
Red = Color("\033[1;31m%s\033[0m")
Green = Color("\033[1;32m%s\033[0m")
Blue = Color("\033[1;34m%s\033[0m")
Cyan = Color("\033[1;36m%s\033[0m")
)
func Color(colorString string) func(...interface{}) string {
sprint := func(args ...interface{}) string {
return fmt.Sprintf(colorString,
fmt.Sprint(args...))
}
return sprint
}
func show_banner() {
fmt.Println(Blue(`
_
___ ___|_| ___ ___ _ _ ___ ___ ___ ___
| .'| . | || . | | | -_|_ -|_ -| -_| _|
|__,| _|_||_ |___|___|___|___|___|_|
|_| |___|
Author: Muhammad Daffa
Version: 1.0
Starting...
`))
}
func main() {
show_banner()
api := flag.String("api", "", "An API Key. Example: tue3sv9hzsey1me4l7fwq3t46u5k8wag")
path := flag.String("path", "", "A file with API Key. Example: daffainfo.txt")
flag.Parse()
if *api != "" && *path == "" && len(*api) > 3 {
fmt.Println(Cyan(*api))
if g.Regex_api(*api) != "" {
fmt.Print(Green(g.Regex_api(*api)))
} else {
fmt.Println(Red("Not Match"))
}
} else if *api == "" && *path != "" {
g.Regex_api_file(*path)
} else if *api != "" || *path != "" {
fmt.Println(Red("Can't call 2 arguments at once"))
}
}