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 minNumWords = 10
  9. const minNumHashtag = 2
  10. const iterationsCount = 3
  11. func main() {
  12. fmt.Println("---------------")
  13. fmt.Print("\x1b[36;1m") //cyan
  14. fmt.Println("goTweetsAnalyze initialized")
  15. fmt.Print("\x1b[0m") //defaultColor
  16. fmt.Println("Reading twitterConfig.json file")
  17. client := readConfigTokensAndConnect()
  18. fmt.Println("---------------")
  19. newcommand := bufio.NewReader(os.Stdin)
  20. fmt.Print("Please select command number")
  21. options := `
  22. 1 - Analyze username
  23. 0 - Exit script
  24. option to select: `
  25. for {
  26. fmt.Print(options)
  27. option, _ := newcommand.ReadString('\n')
  28. option = strings.TrimSpace(option)
  29. switch option {
  30. case "1":
  31. fmt.Println("selected 1 - Analyze username")
  32. getUserTweets(client)
  33. break
  34. case "2":
  35. fmt.Println("selected 2 - Delete all Favs")
  36. break
  37. case "3":
  38. fmt.Println("selected 3 - Delete all Tweets and Favs")
  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. }