flock-botnet/main.go
main.goRaw
1package main
2
3import (
4 "bufio"
5 "fmt"
6 "os"
7 "strings"
8)
9
10const version = "0.1-dev"
11
12func main() {
13 c.Yellow("twFlock")
14 fmt.Println("---------------")
15 c.Cyan("twFlock initialized")
16 c.Purple("https://github.com/arnaucode/twFlock")
17 fmt.Println("version " + version)
18 fmt.Println("Reading flockConfig.json file")
19 //flock := readConfigTokensAndConnect()
20 var flock Flock
21 fmt.Println("---------------")
22 newcommand := bufio.NewReader(os.Stdin)
23 fmt.Print("Please select command number")
24 options := `
25 1 - Tweet from flock of bots
26 2 - Markov
27 0 - Exit script
28option to select: `
29 for {
30 fmt.Print(options)
31
32 option, _ := newcommand.ReadString('\n')
33 option = strings.TrimSpace(option)
34
35 switch option {
36 case "1":
37 fmt.Println("selected 1 - Tweet from flock of bots")
38 optionTweetFromFlock(flock)
39 break
40 case "2":
41 fmt.Println("selected 2 - Markov")
42 states := markov.train("the", "text.txt")
43 generatedText := markov.generateText(states, "Argus", 20)
44 c.Green(generatedText)
45 //fmt.Println(text)
46 break
47 case "0":
48 fmt.Println("selected 0 - exit script")
49 os.Exit(3)
50 break
51 default:
52 fmt.Println("Invalid option")
53 break
54 }
55 }
56}