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.

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