You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.4 KiB

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