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
25 fmt.Println("---------------")
26 fmt.Println("Getting user data...")
27 user := getUserData(client)
28 printUserData(user)
29 fmt.Println("")
30
31 newcommand := bufio.NewReader(os.Stdin)
32 fmt.Print("Please select command number")
33 options := `
34 1 - Analyze username
35 2 - Unfollow all
36 3 - Follow random
37 4 - Delete Tweets
38 5 - Delete Favs (Likes)
39 6 - Tweet Random
40 0 - Exit script
41option to select: `
42 for {
43 fmt.Print(options)
44
45 option, _ := newcommand.ReadString('\n')
46 option = strings.TrimSpace(option)
47
48 switch option {
49 case "1":
50 fmt.Println("selected 1 - Analyze username")
51 optionAnalyzeUserTweets(client)
52 break
53 case "2":
54 fmt.Println("selected 2 - Unfollow all")
55 optionUnfollowAll(client)
56 break
57 case "3":
58 fmt.Println("selected 3 - Follow random")
59 optionFollowRandom(client)
60 break
61 case "4":
62 fmt.Println("selected 4 - Delete Tweets")
63 optionDeleteTweets(client)
64 break
65 case "5":
66 fmt.Println("selected 5 - Delete Favs (Likes)")
67 optionDeleteFavs(client)
68 break
69 case "6":
70 fmt.Println("selected 5 - Tweet random")
71 optionTweetRandom(client)
72 break
73 case "0":
74 fmt.Println("selected 0 - exit script")
75 os.Exit(3)
76 break
77 default:
78 fmt.Println("Invalid option")
79 break
80 }
81 }
82}