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.

54 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. _ = markov.train("the", "text.txt")
  38. //fmt.Println(text)
  39. break
  40. case "0":
  41. fmt.Println("selected 0 - exit script")
  42. os.Exit(3)
  43. break
  44. default:
  45. fmt.Println("Invalid option")
  46. break
  47. }
  48. }
  49. }