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.

56 lines
1.1 KiB

  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("twFlock")
  11. fmt.Println("---------------")
  12. c.Cyan("twFlock initialized")
  13. c.Purple("https://github.com/arnaucode/twFlock")
  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 - Tweet from flock of bots
  23. 2 - Markov
  24. 0 - Exit script
  25. option to select: `
  26. for {
  27. fmt.Print(options)
  28. option, _ := newcommand.ReadString('\n')
  29. option = strings.TrimSpace(option)
  30. switch option {
  31. case "1":
  32. fmt.Println("selected 1 - Tweet from flock of bots")
  33. optionTweetFromFlock(flock)
  34. break
  35. case "2":
  36. fmt.Println("selected 2 - Markov")
  37. states := markov.train("the", "text.txt")
  38. generatedText := markov.generateText(states, "Argus", 20)
  39. c.Green(generatedText)
  40. //fmt.Println(text)
  41. break
  42. case "0":
  43. fmt.Println("selected 0 - exit script")
  44. os.Exit(3)
  45. break
  46. default:
  47. fmt.Println("Invalid option")
  48. break
  49. }
  50. }
  51. }