argos/main.go
main.goRaw
1package main
2
3import (
4 "bufio"
5 "fmt"
6 "os"
7 "strings"
8)
9
10const version = "0.5-beta"
11const minNumWords = 10
12const minNumHashtag = 2
13const minNumUserInteractions = 2
14const iterationsCount = 3
15
16func main() {
17 eye := `
18 ___________
19 .-=d88888888888b=-.
20 .:d8888pr |\|/-\| rq8888b.
21 ,:d8888P^//\-\/_\ /_\/^q888/b.
22 ,;d88888/~-/ .-~ _~-. |/-q88888b,
23 //8888887-\ _/ (#) \\-\/Y88888b\
24 \8888888|// T Y _/|888888 o
25 \q88888|- \l !\_/|88888p/
26 q8888l\-//\ / /\|!8888P
27 q888\/-| -,___.-^\/-\/888P
28 =88\./-/|/ |-/!\/-!/88=
29 ^^ ------------- ^
30 _____ _____ ____ _____
31 /\ | __ \ / ____|/ __ \ / ____|
32 / \ | |__) | | __| | | | (___
33 / /\ \ | _ /| | |_ | | | |\___ \
34 / ____ \| | \ \| |__| | |__| |____) |
35 /_/ \_\_| \_\\_____|\____/|_____/
36
37 Open source twitter entropic toolkit
38 `
39 c.Cyan(eye)
40 c.DarkGray("--Be half bot and half human, a new generation of cyborgs--")
41 fmt.Println("---------------")
42 fmt.Print("source code: ")
43 c.Purple("https://github.com/arnaucode/argos")
44 fmt.Print("project page: ")
45 c.Purple("http://arnaucode/argos")
46 fmt.Print("version ")
47 c.Purple(version)
48 fmt.Println("---------------")
49 client := readConfigTokensAndConnect()
50
51 fmt.Println("Getting user data...")
52 user := getUserData(client)
53 printUserData(user)
54 if user.ScreenName == "" {
55 c.Red("Can not connect to Twitter API, maybe the file twitterConfig.json is wrong")
56 os.Exit(3)
57 }
58 fmt.Println("")
59
60 newcommand := bufio.NewReader(os.Stdin)
61 fmt.Print("Please select command number")
62 options := `
63 1 - Analyze username
64 2 - Unfollow all
65 3 - Follow random
66 4 - Delete Tweets
67 5 - Delete Favs (Likes)
68 6 - Tweet Random
69 7 - Analyze tweet
70 0 - Exit script
71option to select: `
72 for {
73 fmt.Print(options)
74
75 option, _ := newcommand.ReadString('\n')
76 option = strings.TrimSpace(option)
77
78 switch option {
79 case "1":
80 fmt.Println("selected 1 - Analyze username")
81 optionAnalyzeUserTweets(client)
82 fmt.Println("")
83 c.Purple("Note: the current hours displaying, are the Twitter servers hours (Coordinated Universal Time (UTC) +0000 UTC)")
84 break
85 case "2":
86 fmt.Println("selected 2 - Unfollow all")
87 optionUnfollowAll(client)
88 break
89 case "3":
90 fmt.Println("selected 3 - Follow random")
91 optionFollowRandom(client)
92 break
93 case "4":
94 fmt.Println("selected 4 - Delete Tweets")
95 optionDeleteTweets(client)
96 break
97 case "5":
98 fmt.Println("selected 5 - Delete Favs (Likes)")
99 optionDeleteFavs(client)
100 break
101 case "6":
102 fmt.Println("selected 6 - Tweet random")
103 optionTweetRandom(client)
104 break
105 case "7":
106 fmt.Println("selected 7 - Analyze Tweet")
107 optionAnalyzeTweet(client)
108 break
109 case "0":
110 fmt.Println("selected 0 - exit script")
111 os.Exit(3)
112 break
113 default:
114 fmt.Println("Invalid option")
115 break
116 }
117 }
118}