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.

125 lines
3.1 KiB

  1. package main
  2. import (
  3. "bufio"
  4. "fmt"
  5. "os"
  6. "strings"
  7. )
  8. const version = "0.5-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. 8 - Analyze User Followers
  65. 0 - Exit script
  66. option to select: `
  67. for {
  68. fmt.Print(options)
  69. option, _ := newcommand.ReadString('\n')
  70. option = strings.TrimSpace(option)
  71. switch option {
  72. case "1":
  73. fmt.Println("selected 1 - Analyze username")
  74. username := askForUsername()
  75. optionAnalyzeUserTweets(client, username)
  76. fmt.Println("")
  77. c.Purple("Note: the current hours displaying, are the Twitter servers hours (Coordinated Universal Time (UTC) +0000 UTC)")
  78. break
  79. case "2":
  80. fmt.Println("selected 2 - Unfollow all")
  81. optionUnfollowAll(client)
  82. break
  83. case "3":
  84. fmt.Println("selected 3 - Follow random")
  85. optionFollowRandom(client)
  86. break
  87. case "4":
  88. fmt.Println("selected 4 - Delete Tweets")
  89. optionDeleteTweets(client)
  90. break
  91. case "5":
  92. fmt.Println("selected 5 - Delete Favs (Likes)")
  93. optionDeleteFavs(client)
  94. break
  95. case "6":
  96. fmt.Println("selected 6 - Tweet random")
  97. optionTweetRandom(client)
  98. break
  99. case "7":
  100. fmt.Println("selected 7 - Analyze Tweet")
  101. optionAnalyzeTweet(client)
  102. break
  103. case "8":
  104. fmt.Println("selected 8 - Analyze User Followers")
  105. username := askForUsername()
  106. optionAnalyzeUserFollowers(client, username)
  107. break
  108. case "0":
  109. fmt.Println("selected 0 - exit script")
  110. os.Exit(3)
  111. break
  112. default:
  113. fmt.Println("Invalid option")
  114. break
  115. }
  116. }
  117. }