forked from tildeverse/tilde.chat
Compare commits
2 Commits
master
...
stats-blac
Author | SHA1 | Date |
---|---|---|
Robert Miles | 22f596ab4d | |
Robert Miles | 87ef4d25e3 |
|
@ -0,0 +1 @@
|
|||
{"blacklist":["#channel1","#channel2"]}
|
|
@ -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(
|
||||
"#"
|
||||
|
|
Loading…
Reference in New Issue