Instead of doing fancy lstrip or brutalist slicing, just urlencode the entire channel name

This commit is contained in:
Robert Miles 2020-06-23 15:28:00 -04:00
parent 4874785b6e
commit 405a8005e0
1 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python3
import requests, json
import xml.etree.ElementTree as xml
from urllib.parse import quote
WORK_DIR = "/var/www/tilde.chat"
r = requests.get("http://localhost:8081/stats")
@ -41,7 +42,7 @@ for schannel in schannels:
):
continue
channel["webchatlink"] = "https://web.tilde.chat/?join=" + channel["name"][1:]
channel["webchatlink"] = "https://web.tilde.chat/?join=" + quote(channel["name"])
channels.append(channel)