-
Notifications
You must be signed in to change notification settings - Fork 2
/
strobl.py
52 lines (43 loc) · 1.54 KB
/
strobl.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import dateparser
from event import DanceEvent
from timeutil import Weekday, remove_events_between, weekly_event
# https://www.tanzschule-strobl.at/perfektion.html
# 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 sunday evening
events += weekly_event(
Weekday.SUN,
DanceEvent(
starts_at=dateparser.parse("19:00"),
ends_at=dateparser.parse("21:30"),
name="Perfektion",
price_euro_cent=550,
description="keine Anmeldung erforderlich.",
dancing_school="Strobl",
website="https://www.tanzschule-strobl.at/perfektion.html",
),
)
events += weekly_event(
Weekday.WED,
DanceEvent(
starts_at=dateparser.parse("20:00"),
ends_at=dateparser.parse("22:00"),
name="Perfektion mit Karina",
price_euro_cent=550,
description="keine Anmeldung erforderlich.",
dancing_school="Strobl",
website="https://www.tanzschule-strobl.at/perfektion.html",
),
)
# No events in the semester holidays
events = remove_events_between(
dateparser.parse("2024-02-04 00:00"),
dateparser.parse("2024-02-11 23:59"),
events,
)
return events
def download_strobl() -> list[DanceEvent]:
return create_perfections()