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