From 22f596ab4dfc90ba8b3521d3909c93983ebec2ab Mon Sep 17 00:00:00 2001 From: Robert Miles Date: Tue, 6 Nov 2018 09:56:41 -0500 Subject: [PATCH] Update 'gen_stats' This was hard to mess with indents. Why, ben, why? --- gen_stats | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gen_stats b/gen_stats index dc955c8..a847e1b 100755 --- a/gen_stats +++ b/gen_stats @@ -2,6 +2,10 @@ import requests, json import xml.etree.ElementTree as xml +try: + with open("blacklist.json") as f: + BLACKLIST = json.load(f)["blacklist"] + r = requests.get("http://localhost:8081/stats") r.raise_for_status() out = {} @@ -35,8 +39,8 @@ for schannel in schannels: and channel["topic"] != "No topic set" ): channel["topic"] = "Topic hidden" - if channel["name"] == "#secret-sudoers": - # no stat output for #secret-sudoers! it's a sekrit club of the ~team sysadmins! + if channel["name"] in BLACKLIST: + # no stat output for blacklisted channels!!!! continue channel["webchatlink"] = "https://web.tilde.chat/?join=" + channel["name"].lstrip( "#"