Update 'gen_stats'

This was hard to mess with indents. Why, ben, why?
This commit is contained in:
Robert Miles 2018-11-06 09:56:41 -05:00
parent 87ef4d25e3
commit 22f596ab4d
1 changed files with 6 additions and 2 deletions

View File

@ -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(
"#"