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.

50 lines
953 B

7 years ago
  1. package main
  2. import (
  3. "bufio"
  4. "fmt"
  5. "os"
  6. "strings"
  7. )
  8. const minNumWords = 3
  9. func main() {
  10. fmt.Println("---------------")
  11. fmt.Println("goTweetsAnalyze initialized")
  12. fmt.Println("Reading twitterConfig.json file")
  13. client := readConfigTokensAndConnect()
  14. fmt.Println("---------------")
  15. newcommand := bufio.NewReader(os.Stdin)
  16. fmt.Print("Please select command number:")
  17. options := `
  18. 1 - Analyze username
  19. 0 - Exit script
  20. option to select: `
  21. for {
  22. fmt.Print(options)
  23. option, _ := newcommand.ReadString('\n')
  24. option = strings.TrimSpace(option)
  25. switch option {
  26. case "1":
  27. fmt.Println("selected 1 - Analyze username")
  28. getUser(client)
  29. break
  30. case "2":
  31. fmt.Println("selected 2 - Delete all Favs")
  32. break
  33. case "3":
  34. fmt.Println("selected 3 - Delete all Tweets and Favs")
  35. break
  36. case "0":
  37. fmt.Println("selected 0 - exit script")
  38. os.Exit(3)
  39. break
  40. default:
  41. fmt.Println("Invalid option")
  42. break
  43. }
  44. }
  45. }