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 minNumUserInteractions = 1
14const iterationsCount = 3
15
16func main() {
17 c.Yellow("Argos Panoptes")
18 fmt.Println("---------------")
19 c.Cyan("argos initialized")
20 c.Purple("https://github.com/arnaucode/argos")
21 fmt.Println("version " + version)
22 fmt.Println("Reading twitterConfig.json file")
23 client := readConfigTokensAndConnect()
24 fmt.Println("---------------")
25 newcommand := bufio.NewReader(os.Stdin)
26 fmt.Print("Please select command number")
27 options := `
28 1 - Analyze username
29 2 - Unfollow all
30 3 - Follow random
31 4 - Delete Tweets
32 5 - Tweet Random
33 0 - Exit script
34option to select: `
35 for {
36 fmt.Print(options)
37
38 option, _ := newcommand.ReadString('\n')
39 option = strings.TrimSpace(option)
40
41 switch option {
42 case "1":
43 fmt.Println("selected 1 - Analyze username")
44 optionGetUserTweets(client)
45 break
46 case "2":
47 fmt.Println("selected 2 - Unfollow all")
48 optionUnfollowAll(client)
49 break
50 case "3":
51 fmt.Println("selected 3 - Follow random")
52 optionFollowRandom(client)
53 break
54 case "4":
55 fmt.Println("selected 4 - Delete Tweets")
56 optionDeleteTweets(client)
57 break
58 case "5":
59 fmt.Println("selected 5 - Tweet random")
60 optionTweetRandom(client)
61 break
62 case "0":
63 fmt.Println("selected 0 - exit script")
64 os.Exit(3)
65 break
66 default:
67 fmt.Println("Invalid option")
68 break
69 }
70 }
71}