Skip to content

Commit

Permalink
feat(examples): more -collection-schedules icalendar metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Jan 23, 2024
1 parent e93346e commit 1aee758
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/pytekukko/examples/print_collection_schedules.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ async def run_example() -> None:
cal = icalendar.Calendar()
cal.add("PRODID", f"pytekukko/{pytekukko.__version__}")
cal.add("VERSION", "2.0")
cal.add("NAME", "Jätekukko collections")
cal.add("X-WR-CALNAME", "Jätekukko collections")
cal.add("URL", "https://tilasto.jatekukko.fi/indexservice2.jsp")
cal.add("X-WR-TIMEZONE", "Europe/Helsinki")
cal.add("METHOD", "PUBLISH")
for service, schedule in data:
for date in schedule:
event = icalendar.Event()
Expand All @@ -45,6 +50,7 @@ async def run_example() -> None:
event.add("DTSTAMP", now)
event.add("DTSTART", date)
event.add("DTEND", date + timedelta(days=1))
event.add("URL", "https://tilasto.jatekukko.fi/indexservice2.jsp")
cal.add_component(event)
sys.stdout.buffer.write(cal.to_ical())
else:
Expand Down

0 comments on commit 1aee758

Please sign in to comment.