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 2 - Delete Tweets
31 0 - Exit script
32option to select: `
33 for {
34 fmt.Print(options)
35
36 option, _ := newcommand.ReadString('\n')
37 option = strings.TrimSpace(option)
38
39 switch option {
40 case "1":
41 fmt.Println("selected 1 - Analyze username")
42 getUserTweets(client)
43 break
44 case "2":
45 fmt.Println("selected 2 - Delete Tweets")
46 deleteTweetsAndFavs(client)
47 break
48 case "0":
49 fmt.Println("selected 0 - exit script")
50 os.Exit(3)
51 break
52 default:
53 fmt.Println("Invalid option")
54 break
55 }
56 }
57}