From 9b6d2db7f0bc24d9bf980df5c185c644029b9ef9 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Sun, 28 Oct 2018 12:46:55 +0900 Subject: [PATCH] Added a patch to show languages --- .../show-user-languages.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 patches/show-user-languages/show-user-languages.go diff --git a/patches/show-user-languages/show-user-languages.go b/patches/show-user-languages/show-user-languages.go new file mode 100644 index 00000000..edf64008 --- /dev/null +++ b/patches/show-user-languages/show-user-languages.go @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + + "github.com/animenotifier/arn" +) + +func main() { + languages := map[string]int{} + + for user := range arn.StreamUsers() { + languages[user.Language]++ + } + + for language, users := range languages { + fmt.Printf("* [%s] %d users\n", language, users) + } +}