aboutsummaryrefslogtreecommitdiff
path: root/extract-title
diff options
context:
space:
mode:
authordiogo464 <[email protected]>2025-07-24 17:03:18 +0100
committerdiogo464 <[email protected]>2025-07-24 17:03:18 +0100
commit944d87cac0ac9f7098b0ee0f9132ce256eedd3b8 (patch)
treee17da3fd8242621017fd6c2f9baa04f8e7371f72 /extract-title
parent5c3fe9aac767ee44f271ea8d1086b28336c88334 (diff)
fix: run html.unescape on the title
some titles contains things like '&#8211' so we run html.unescape to remove them.
Diffstat (limited to 'extract-title')
-rwxr-xr-xextract-title3
1 files changed, 2 insertions, 1 deletions
diff --git a/extract-title b/extract-title
index 46b4d3630..334ad9946 100755
--- a/extract-title
+++ b/extract-title
@@ -2,13 +2,14 @@
2import os 2import os
3import sys 3import sys
4import json 4import json
5import html
5 6
6for slug in sys.argv[1:]: 7for slug in sys.argv[1:]:
7 data_path = os.path.join("events", slug, "data.json") 8 data_path = os.path.join("events", slug, "data.json")
8 title_path = os.path.join("events", slug, "title") 9 title_path = os.path.join("events", slug, "title")
9 with open(data_path, "r") as f: 10 with open(data_path, "r") as f:
10 data = json.load(f) 11 data = json.load(f)
11 title = data["title"]["rendered"] 12 title = html.unescape(data["title"]["rendered"])
12 if os.path.exists(title_path): 13 if os.path.exists(title_path):
13 continue 14 continue
14 with open(title_path, "w") as f: 15 with open(title_path, "w") as f: