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.

49 lines
1.0 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. package main
  2. import (
  3. "fmt"
  4. "log"
  5. "time"
  6. "github.com/fatih/color"
  7. )
  8. const version = "0.1-dev"
  9. func main() {
  10. savelog()
  11. color.Blue("echo-botnet")
  12. fmt.Println("---------------")
  13. color.Cyan("echo-botnet initialized")
  14. color.Green("https://github.com/arnaucode/echo-botnet")
  15. log.Println("version " + version)
  16. readKeywordsConfig()
  17. color.Cyan("keywords configured: ")
  18. fmt.Println(keywords)
  19. readRepliesConfig()
  20. color.Cyan("replies configured: ")
  21. fmt.Println(replies)
  22. fmt.Println("Reading botsConfig.json file")
  23. readConfigTokensAndConnect()
  24. color.Cyan("[list of configured bots]:")
  25. for _, bot := range botnet {
  26. color.Cyan(bot.Title)
  27. }
  28. var i int
  29. for {
  30. sinceTweeted := time.Unix(botnet[i].SinceTweeted, 0)
  31. elapsed := time.Since(sinceTweeted)
  32. if elapsed.Seconds() > 60 {
  33. color.Blue("starting to use bot: " + botnet[i].Title)
  34. startStreaming(&botnet[i])
  35. } else {
  36. //log.Println("bot: " + botnet[i].Title + " not used due bot is in waiting time")
  37. }
  38. i++
  39. if i > len(botnet)-1 {
  40. i = 0
  41. }
  42. }
  43. }