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