diff --git a/sendMatrix.py b/sendMatrix.py index 32908c8..0d2082f 100644 --- a/sendMatrix.py +++ b/sendMatrix.py @@ -7,6 +7,8 @@ from markdown2 import Markdown import asyncio import datetime +from scraping import get_soup, process_soup, get_events_today + MATRIX_URL=os.environ["MATRIX_URL"] MATRIX_USER=os.environ["MATRIX_USER"] MATRIX_TOKEN=os.environ["MATRIX_TOKEN"] @@ -48,7 +50,11 @@ async def main() -> None: client = AsyncClient(MATRIX_URL, MATRIX_USER) client.access_token = MATRIX_TOKEN - await sendMatrixAnnouncement(Event(1, datetime.datetime.now(), "Name", "Location", "PVV", "Description"), ANNOUNCEMENT_CHANNEL, False) + s = get_soup() + es = get_events_today(process_soup(s)) + + for e in es: + await sendMatrixAnnouncement(e, ANNOUNCEMENT_CHANNEL, False) await client.close()