mirror of
https://github.com/Xevion/scla-unsubscribe.git
synced 2025-12-08 06:08:20 -06:00
Add optional fake email unsubscribing, process emails in go routines
This commit is contained in:
10
main.go
10
main.go
@@ -2,6 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"math/rand"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/http/cookiejar"
|
"net/http/cookiejar"
|
||||||
"net/url"
|
"net/url"
|
||||||
@@ -170,6 +171,13 @@ func main() {
|
|||||||
|
|
||||||
// Process each email
|
// Process each email
|
||||||
for email := range entries {
|
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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user