forked from tildeverse/tilde.chat
fix filepaths
This commit is contained in:
parent
a4242090b0
commit
c2fc0237fe
|
@ -2,13 +2,14 @@
|
|||
import requests, json
|
||||
import xml.etree.ElementTree as xml
|
||||
|
||||
WORK_DIR = "/var/www/tilde.chat"
|
||||
r = requests.get("http://localhost:8081/stats")
|
||||
r.raise_for_status()
|
||||
out = {}
|
||||
d = xml.fromstring(r.text)
|
||||
assert d.tag == "inspircdstats"
|
||||
|
||||
with open("blacklist", "r") as f:
|
||||
with open(f"{WORK_DIR}/blacklist", "r") as f:
|
||||
BLACKLIST = f.read().splitlines()
|
||||
|
||||
def define(name, xps, vfilter=lambda x: x):
|
||||
|
@ -49,5 +50,5 @@ channels.sort(key=lambda x: x["name"].lower())
|
|||
out["channels"] = channels
|
||||
|
||||
# print([x.text for x in d.findall("./channellist/channel/channeltopic/topictext")])
|
||||
with open("/var/www/tilde.chat/stats.json", "w") as f:
|
||||
with open(f"{WORK_DIR}/stats.json", "w") as f:
|
||||
json.dump(out, f)
|
||||
|
|
Loading…
Reference in New Issue
Block a user