aboutsummaryrefslogtreecommitdiff
path: root/fetch-ics
diff options
context:
space:
mode:
authordiogo464 <[email protected]>2025-07-21 15:02:48 +0100
committerdiogo464 <[email protected]>2025-07-21 15:02:48 +0100
commit8c8dabd0ed20679a2dad43a5c239f9fcfe1c1ad7 (patch)
tree55abbcfbbff19efa3aaf6cf36540ac7651c54973 /fetch-ics
init
Diffstat (limited to 'fetch-ics')
-rwxr-xr-xfetch-ics17
1 files changed, 17 insertions, 0 deletions
diff --git a/fetch-ics b/fetch-ics
new file mode 100755
index 000000000..0b06ddac3
--- /dev/null
+++ b/fetch-ics
@@ -0,0 +1,17 @@
1#!/usr/bin/env python3
2import os
3import sys
4import requests
5
6for slug in sys.argv[1:]:
7 id_path = os.path.join("events", slug, "id")
8 id = open(id_path, "r").read()
9 ics_path = os.path.join("events", slug, "ics")
10 if os.path.exists(ics_path):
11 continue
12 ics_url = f"http://www.portugalrunning.com/export-events/{id}_0/"
13 response = requests.get(ics_url)
14 response.raise_for_status()
15 with open(ics_path, "wb") as f:
16 f.write(response.content)
17