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 version = "0.1-dev"
11const minNumWords = 10
12const minNumHashtag = 2
13const iterationsCount = 3
14
15func main() {
16	fmt.Println("---------------")
17	fmt.Print("\x1b[36;1m") //cyan
18	fmt.Println("goTweetsAnalyze initialized")
19	fmt.Print("\x1b[35;1m") //cyan
20	fmt.Println("https://github.com/arnaucode/goTweetsAnalyze")
21	fmt.Print("\x1b[0m") //defaultColor
22	fmt.Println("version " + version)
23	fmt.Println("Reading twitterConfig.json file")
24	client := readConfigTokensAndConnect()
25	fmt.Println("---------------")
26	newcommand := bufio.NewReader(os.Stdin)
27	fmt.Print("Please select command number")
28	options := `
29	1 - Analyze username
30	0 - Exit script
31option to select: `
32	for {
33		fmt.Print(options)
34
35		option, _ := newcommand.ReadString('\n')
36		option = strings.TrimSpace(option)
37
38		switch option {
39		case "1":
40			fmt.Println("selected 1 - Analyze username")
41			getUserTweets(client)
42			break
43		case "2":
44			fmt.Println("selected 2 - Delete all Favs")
45			break
46		case "3":
47			fmt.Println("selected 3 - Delete all Tweets and Favs")
48			break
49		case "0":
50			fmt.Println("selected 0 - exit script")
51			os.Exit(3)
52			break
53		default:
54			fmt.Println("Invalid option")
55			break
56		}
57	}
58}