From bbaa3597f6f359c62a9c6f6369729b3eee38d796 Mon Sep 17 00:00:00 2001 From: Ian Renton Date: Sun, 2 Nov 2025 20:37:30 +0000 Subject: [PATCH] Implement WWFF reference lookup. Closes #76 --- core/sig_utils.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/sig_utils.py b/core/sig_utils.py index 71bdd6c..f71ebcf 100644 --- a/core/sig_utils.py +++ b/core/sig_utils.py @@ -69,7 +69,16 @@ def get_sig_ref_info(sig, sig_ref_id): sig_ref.latitude = data["latitude"] if "latitude" in data else None sig_ref.longitude = data["longitude"] if "longitude" in data else None elif sig.upper() == "WWFF": - sig_ref.url = "https://wwff.co/directory/?showRef=" + sig_ref_id + wwff_csv_data = SEMI_STATIC_URL_DATA_CACHE.get("https://wwff.co/wwff-data/wwff_directory.csv", + headers=HTTP_HEADERS) + wwff_dr = csv.DictReader(wwff_csv_data.content.decode().splitlines()) + for row in wwff_dr: + if row["reference"] == sig_ref_id: + sig_ref.name = row["name"] if "name" in row else None + sig_ref.url = "https://wwff.co/directory/?showRef=" + sig_ref_id + sig_ref.grid = row["iaruLocator"] if "iaruLocator" in row else None + sig_ref.latitude = float(row["latitude"]) if "latitude" in row else None + sig_ref.longitude = float(row["longitude"]) if "longitude" in row else None elif sig.upper() == "SIOTA": siota_csv_data = SEMI_STATIC_URL_DATA_CACHE.get("https://www.silosontheair.com/data/silos.csv", headers=HTTP_HEADERS)