aboutsummaryrefslogtreecommitdiff
path: root/extract-title
diff options
context:
space:
mode:
authordiogo464 <[email protected]>2025-07-24 11:15:17 +0100
committerdiogo464 <[email protected]>2025-07-24 11:15:17 +0100
commit9111cb454a6ea62dacbafad49a0aabafc7066bf8 (patch)
treee93269cd93f588c9db456dc7768b17059e499553 /extract-title
parent47b06ad0b6fa9c6e6a352ef7d6f25297ad3aaf72 (diff)
added extract-title
Diffstat (limited to 'extract-title')
-rwxr-xr-xextract-title16
1 files changed, 16 insertions, 0 deletions
diff --git a/extract-title b/extract-title
new file mode 100755
index 000000000..46b4d3630
--- /dev/null
+++ b/extract-title
@@ -0,0 +1,16 @@
1#!/usr/bin/env python3
2import os
3import sys
4import json
5
6for slug in sys.argv[1:]:
7 data_path = os.path.join("events", slug, "data.json")
8 title_path = os.path.join("events", slug, "title")
9 with open(data_path, "r") as f:
10 data = json.load(f)
11 title = data["title"]["rendered"]
12 if os.path.exists(title_path):
13 continue
14 with open(title_path, "w") as f:
15 f.write(title)
16