diff --git a/bot.py b/bot.py
index 1168de0..35792d5 100644
--- a/bot.py
+++ b/bot.py
@@ -99,10 +99,14 @@ async def main():
except FileNotFoundError:
state = {"notified": [], "notified_soon": []}
+ urls = os.getenv("PISS_URLS", "").split(",")
+ if not urls:
+ raise RuntimeError("No PISS_URLS specified!")
+
while True:
calendars = []
async with aiohttp.ClientSession() as session:
- for url in config.URLS:
+ for url in urls:
logging.debug(f"Requesting {url}...")
async with session.get(url) as resp:
calendars.append(Calendar(await resp.text()))
diff --git a/config.py b/config.py
index 1b320b5..e7e5fb3 100644
--- a/config.py
+++ b/config.py
@@ -3,11 +3,6 @@ class Config:
TG_API_KEY = None
TG_CHAT_ID = None
AVATAR_URL = 'https://gitlab.com/sdbs_cz/piss-bot/-/raw/master/piss.jpg'
- URLS = [
- 'https://sdbs.cz/wp-content/themes/sdbs/file-download.php?type=in',
- 'https://sdbs.cz/wp-content/themes/sdbs/file-download.php?type=out',
- 'http://cloud.sdbs.cz/remote.php/dav/public-calendars/R5kWLqcrDFaQYE2e?export'
- ]
EVENT_TEMPLATE = "
".join((
"{title}",
"{date} {location}",