arnaucube
arnaucube/argosPublic Self-hosted repository
argos/main.go
main.goRaw
 1package main
 2
 3import (
 4	"bufio"
 5	"fmt"
 6	"os"
 7	"strings"
 8)
 9
10const minNumWords = 3
11
12func main() {
13	fmt.Println("---------------")
14	fmt.Println("goTweetsAnalyze initialized")
15	fmt.Println("Reading twitterConfig.json file")
16	client := readConfigTokensAndConnect()
17
18	fmt.Println("---------------")
19	newcommand := bufio.NewReader(os.Stdin)
20	fmt.Print("Please select command number:")
21	options := `
22	1 - Analyze username
23	0 - Exit script
24option to select: `
25	for {
26		fmt.Print(options)
27		option, _ := newcommand.ReadString('\n')
28		option = strings.TrimSpace(option)
29
30		switch option {
31		case "1":
32			fmt.Println("selected 1 - Analyze username")
33			getUser(client)
34			break
35		case "2":
36			fmt.Println("selected 2 - Delete all Favs")
37			break
38		case "3":
39			fmt.Println("selected 3 - Delete all Tweets and Favs")
40			break
41		case "0":
42			fmt.Println("selected 0 - exit script")
43			os.Exit(3)
44			break
45		default:
46			fmt.Println("Invalid option")
47			break
48		}
49	}
50}