From 1c00df80efa0ee43137c63013cc981c905624996 Mon Sep 17 00:00:00 2001 From: Benjamin Mako Hill Date: Mon, 27 Feb 2023 17:06:11 -0800 Subject: [PATCH 1/1] urlencode tags in the urls we're generating --- taguette-export_tags_to_csv.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/taguette-export_tags_to_csv.py b/taguette-export_tags_to_csv.py index d0fd28c..a3c163f 100755 --- a/taguette-export_tags_to_csv.py +++ b/taguette-export_tags_to_csv.py @@ -6,6 +6,7 @@ import sqlite3 from configparser import ConfigParser import csv import os +import urllib.parse config_files = [f for f in os.listdir() if f.startswith('.taguette_gdocs')] @@ -58,6 +59,7 @@ for file_path in config_files: category = "" # create a URL that will link to the list of highlights - url = f"https://taguette.communitydata.science/project/{project_id}/highlights/{tag}" + tag_url = urllib.parse.quote(tag) + url = f"https://taguette.communitydata.science/project/{project_id}/highlights/{tag_url}" writer.writerow([str(tag_id), axial, tag, category, description, url]) -- 2.39.5