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.

82 lines
1.7 KiB

7 years ago
7 years ago
  1. package main
  2. import (
  3. "bufio"
  4. "fmt"
  5. "os"
  6. "strings"
  7. )
  8. const version = "0.1-dev"
  9. const minNumWords = 10
  10. const minNumHashtag = 2
  11. const minNumUserInteractions = 1
  12. const iterationsCount = 3
  13. func main() {
  14. c.Yellow("Argos Panoptes")
  15. fmt.Println("---------------")
  16. c.Cyan("argos initialized")
  17. c.Purple("https://github.com/arnaucode/argos")
  18. fmt.Println("version " + version)
  19. fmt.Println("Reading twitterConfig.json file")
  20. client := readConfigTokensAndConnect()
  21. fmt.Println("---------------")
  22. fmt.Println("Getting user data...")
  23. user := getUserData(client)
  24. printUserData(user)
  25. fmt.Println("")
  26. newcommand := bufio.NewReader(os.Stdin)
  27. fmt.Print("Please select command number")
  28. options := `
  29. 1 - Analyze username
  30. 2 - Unfollow all
  31. 3 - Follow random
  32. 4 - Delete Tweets
  33. 5 - Delete Favs (Likes)
  34. 6 - Tweet Random
  35. 0 - Exit script
  36. option to select: `
  37. for {
  38. fmt.Print(options)
  39. option, _ := newcommand.ReadString('\n')
  40. option = strings.TrimSpace(option)
  41. switch option {
  42. case "1":
  43. fmt.Println("selected 1 - Analyze username")
  44. optionAnalyzeUserTweets(client)
  45. break
  46. case "2":
  47. fmt.Println("selected 2 - Unfollow all")
  48. optionUnfollowAll(client)
  49. break
  50. case "3":
  51. fmt.Println("selected 3 - Follow random")
  52. optionFollowRandom(client)
  53. break
  54. case "4":
  55. fmt.Println("selected 4 - Delete Tweets")
  56. optionDeleteTweets(client)
  57. break
  58. case "5":
  59. fmt.Println("selected 5 - Delete Favs (Likes)")
  60. optionDeleteFavs(client)
  61. break
  62. case "6":
  63. fmt.Println("selected 5 - Tweet random")
  64. optionTweetRandom(client)
  65. break
  66. case "0":
  67. fmt.Println("selected 0 - exit script")
  68. os.Exit(3)
  69. break
  70. default:
  71. fmt.Println("Invalid option")
  72. break
  73. }
  74. }
  75. }