-
Notifications
You must be signed in to change notification settings - Fork 2
/
dorner.py
34 lines (28 loc) · 1.22 KB
/
dorner.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://tanzdorner.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 friday evening
for weekday in [Weekday.FRI]:
events += weekly_event(
weekday,
DanceEvent(
starts_at=dateparser.parse("20:15"),
ends_at=dateparser.parse("22:15"),
name="Perfektion",
price_euro_cent=700,
description="Favoritenstraße 20, 1040 Wien\nFreitagsperfektion TanzZeit\nIm Dorner Club inkludiert I Dorner Schüler:innen € 5,-- I Gäste € 7,-",
dancing_school="Dorner",
website="https://tanzdorner.at/#perfektion",
),
)
return events
def download_dorner() -> list[DanceEvent]:
return create_perfections()