From adb2f4a8332e87ee00013b3c64ff9739c527e576 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Wed, 21 Nov 2018 21:05:20 +0900 Subject: [PATCH] Added patch for intros --- patches/user-show-intros/user-show-intros.go | 28 ++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 patches/user-show-intros/user-show-intros.go diff --git a/patches/user-show-intros/user-show-intros.go b/patches/user-show-intros/user-show-intros.go new file mode 100644 index 00000000..6c0b8f9a --- /dev/null +++ b/patches/user-show-intros/user-show-intros.go @@ -0,0 +1,28 @@ +package main + +import ( + "regexp" + + "github.com/animenotifier/arn" + "github.com/fatih/color" +) + +var flaggedWords = regexp.MustCompile("fuck|fucking|freaking|shit|bad|terrible|awful|wtf") + +func main() { + color.Yellow("Showing user intros") + + defer color.Green("Finished.") + defer arn.Node.Close() + + for user := range arn.StreamUsers() { + if user.Introduction == "" { + continue + } + + if flaggedWords.MatchString(user.Introduction) { + color.Cyan(user.Nick) + color.Red(user.Introduction) + } + } +}