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.

118 lines
2.8 KiB

  1. package main
  2. import (
  3. "bufio"
  4. "fmt"
  5. "os"
  6. "strings"
  7. )
  8. const version = "0.3-beta"
  9. const minNumWords = 10
  10. const minNumHashtag = 2
  11. const minNumUserInteractions = 2
  12. const iterationsCount = 3
  13. func main() {
  14. eye := `
  15. ___________
  16. .-=d88888888888b=-.
  17. .:d8888pr |\|/-\| rq8888b.
  18. ,:d8888P^//\-\/_\ /_\/^q888/b.
  19. ,;d88888/~-/ .-~ _~-. |/-q88888b,
  20. //8888887-\ _/ (#) \\-\/Y88888b\
  21. \8888888|// T Y _/|888888 o
  22. \q88888|- \l !\_/|88888p/
  23. q8888l\-//\ / /\|!8888P
  24. q888\/-| -,___.-^\/-\/888P
  25. =88\./-/|/ |-/!\/-!/88=
  26. ^^ ------------- ^
  27. _____ _____ ____ _____
  28. /\ | __ \ / ____|/ __ \ / ____|
  29. / \ | |__) | | __| | | | (___
  30. / /\ \ | _ /| | |_ | | | |\___ \
  31. / ____ \| | \ \| |__| | |__| |____) |
  32. /_/ \_\_| \_\\_____|\____/|_____/
  33. Open source twitter entropic toolkit
  34. `
  35. c.Cyan(eye)
  36. c.DarkGray("--Be half bot and half human, a new generation of cyborgs--")
  37. fmt.Println("---------------")
  38. fmt.Print("source code: ")
  39. c.Purple("https://github.com/arnaucode/argos")
  40. fmt.Print("project page: ")
  41. c.Purple("http://arnaucode/argos")
  42. fmt.Print("version ")
  43. c.Purple(version)
  44. fmt.Println("---------------")
  45. client := readConfigTokensAndConnect()
  46. fmt.Println("Getting user data...")
  47. user := getUserData(client)
  48. printUserData(user)
  49. if user.ScreenName == "" {
  50. c.Red("Can not connect to Twitter API, maybe the file twitterConfig.json is wrong")
  51. os.Exit(3)
  52. }
  53. fmt.Println("")
  54. newcommand := bufio.NewReader(os.Stdin)
  55. fmt.Print("Please select command number")
  56. options := `
  57. 1 - Analyze username
  58. 2 - Unfollow all
  59. 3 - Follow random
  60. 4 - Delete Tweets
  61. 5 - Delete Favs (Likes)
  62. 6 - Tweet Random
  63. 7 - Analyze tweet
  64. 0 - Exit script
  65. option to select: `
  66. for {
  67. fmt.Print(options)
  68. option, _ := newcommand.ReadString('\n')
  69. option = strings.TrimSpace(option)
  70. switch option {
  71. case "1":
  72. fmt.Println("selected 1 - Analyze username")
  73. optionAnalyzeUserTweets(client)
  74. fmt.Println("")
  75. c.Purple("Note: the current hours displaying, are the Twitter servers hours (Coordinated Universal Time (UTC) +0000 UTC)")
  76. break
  77. case "2":
  78. fmt.Println("selected 2 - Unfollow all")
  79. optionUnfollowAll(client)
  80. break
  81. case "3":
  82. fmt.Println("selected 3 - Follow random")
  83. optionFollowRandom(client)
  84. break
  85. case "4":
  86. fmt.Println("selected 4 - Delete Tweets")
  87. optionDeleteTweets(client)
  88. break
  89. case "5":
  90. fmt.Println("selected 5 - Delete Favs (Likes)")
  91. optionDeleteFavs(client)
  92. break
  93. case "6":
  94. fmt.Println("selected 6 - Tweet random")
  95. optionTweetRandom(client)
  96. break
  97. case "7":
  98. fmt.Println("selected 7 - Analyze Tweet")
  99. optionAnalyzeTweet(client)
  100. break
  101. case "0":
  102. fmt.Println("selected 0 - exit script")
  103. os.Exit(3)
  104. break
  105. default:
  106. fmt.Println("Invalid option")
  107. break
  108. }
  109. }
  110. }