arnaucube
arnaucube/flock-botnetPublic Self-hosted repository
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("flock-botnet")
14	fmt.Println("---------------")
15	c.Cyan("flock-botnet initialized")
16	c.Purple("https://github.com/arnaucode/flock-botnet")
17	fmt.Println("version " + version)
18	fmt.Println("Reading flockConfig.json file")
19	flock := readConfigTokensAndConnect()
20
21	//var flock Flock
22	fmt.Println("---------------")
23	newcommand := bufio.NewReader(os.Stdin)
24	fmt.Print("Please select command number")
25	options := `
26	1 - Manual tweet from flock of bots
27	2 - Markov manual text generator
28	3 - Markov's Flock Botnet
29	0 - Exit script
30option to select: `
31	for {
32		fmt.Print(options)
33
34		option, _ := newcommand.ReadString('\n')
35		option = strings.TrimSpace(option)
36
37		switch option {
38		case "1":
39			fmt.Println("selected 1 - Manual tweet from flock of bots")
40			optionManualTweetFromFlock(flock)
41			break
42		case "2":
43			fmt.Println("selected 2 - Markov manual text generator")
44			c.Yellow("generating markov chains (may take some seconds)")
45			text, _ := readTxt("text.txt")
46			states := markov.train(text)
47			c.Green("markov chains generated")
48
49			optionTweetMarkov(states)
50			break
51		case "3":
52			fmt.Println("selected 3 - Markov Flock Botnet")
53			optionMarkovFlockBotnet(flock)
54			break
55		case "0":
56			fmt.Println("selected 0 - exit script")
57			os.Exit(3)
58			break
59		default:
60			fmt.Println("Invalid option")
61			break
62		}
63	}
64}