-
Notifications
You must be signed in to change notification settings - Fork 2
/
kopetzky.py
34 lines (28 loc) · 1.17 KB
/
kopetzky.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import dateparser
from event import DanceEvent
from timeutil import Weekday, weekly_event
# So the website for the dance perfections isn't easily parsable, so the best
# solution for now is to hardcode the events which we can read from the website:
# https://kopetzky.at/Perfektion
# FIXME: yes this whole approach is a bit hacky and means that if the content
# on the website changes we need to change code. Even worse we probably won't
# notice that the website changes.
def create_perfections() -> list[DanceEvent]:
events = []
# Every saturday and sunday evening
for weekday in [Weekday.SAT, Weekday.SUN]:
events += weekly_event(
weekday,
DanceEvent(
starts_at=dateparser.parse("19:30"),
ends_at=dateparser.parse("21:30"),
name="Perfektion",
price_euro_cent=500,
description="Offener Tanzabend für alle! Kursteilnahme nicht notwendig.",
dancing_school="Kopetzky",
website="https://kopetzky.at/Perfektion",
),
)
return events
def download_kopetzky() -> list[DanceEvent]:
return create_perfections()