From f7901569fc3a3b9b7aba6434903bd7c5f9bcad47 Mon Sep 17 00:00:00 2001 From: Xevion Date: Sat, 30 Dec 2023 14:43:07 -0600 Subject: [PATCH] Add optional fake email unsubscribing, process emails in go routines --- main.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 97cbb40..a9a7d29 100644 --- a/main.go +++ b/main.go @@ -2,6 +2,7 @@ package main import ( "encoding/json" + "math/rand" "net/http" "net/http/cookiejar" "net/url" @@ -170,6 +171,13 @@ func main() { // Process each email for email := range entries { - log.Debug().Str("email", email).Msg("Processing Email") + log.Info().Str("email", email).Msg("Unsubscribing Email") + go Unsubscribe(email) + + // 1/2 chance to unsubscribe fake email + if rand.Intn(2) == 0 { + log.Info().Str("email", email).Msg("Unsubscribing Fake Email") + go Unsubscribe(email) + } } }