Compare commits

...

2 Commits

Author SHA1 Message Date
Robert Miles 22f596ab4d Update 'gen_stats'
This was hard to mess with indents. Why, ben, why?
2018-11-06 09:56:41 -05:00
Robert Miles 87ef4d25e3 Add example blacklist file 2018-11-06 09:54:50 -05:00
2 changed files with 7 additions and 2 deletions

1
blacklist.json.example Normal file
View File

@ -0,0 +1 @@
{"blacklist":["#channel1","#channel2"]}

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