From 3f827c597bd598152abd9077c45515753f8162eb Mon Sep 17 00:00:00 2001 From: Ian Renton Date: Sat, 25 Oct 2025 10:34:52 +0100 Subject: [PATCH] Extract spotter information from comments of RBNHole and SOTAMAT posts --- data/spot.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/data/spot.py b/data/spot.py index 342faca..84e4db0 100644 --- a/data/spot.py +++ b/data/spot.py @@ -177,6 +177,20 @@ class Spot: if self.de_call and "-" in self.de_call: self.de_call = self.de_call.split("-")[0] + # If we have a spotter of "RBNHOLE", we should have the actual spotter callsign in the comment, so extract it. + # RBNHole posts come from a number of providers, so it's dealt with here in the generic spot handling code. + if self.de_call == "RBNHOLE" and self.comment: + rbnhole_call_match = re.search(r"\Wat ([a-z0-9/]+)\W", self.comment, re.IGNORECASE) + if rbnhole_call_match: + self.de_call = rbnhole_call_match.group(1).upper() + + # If we have a spotter of "SOTAMAT", we might have the actual spotter callsign in the comment, if so extract it. + # SOTAMAT can do POTA as well as SOTA, so it's dealt with here in the generic spot handling code. + if self.de_call == "SOTAMAT" and self.comment: + sotamat_call_match = re.search(r"\Wfrom ([a-z0-9/]+)]", self.comment, re.IGNORECASE) + if sotamat_call_match: + self.de_call = sotamat_call_match.group(1).upper() + # Spotter country, continent, zones etc. from callsign. # DE of "RBNHOLE" and "SOTAMAT" are not things we can look up location for if self.de_call != "RBNHOLE" and self.de_call != "SOTAMAT": @@ -276,8 +290,8 @@ class Spot: self.dx_location_good = self.dx_location_source == "SPOT" or self.dx_location_source == "WAB/WAI GRID" or ( self.dx_location_source == "QRZ" and not "/" in self.dx_call) - # DE of "RBNHOLE", "SOTAMAT" and "ZLOTA" are not things we can look up location for - if self.de_call != "RBNHOLE" and self.de_call != "SOTAMAT" and self.de_call != "ZLOTA": + # DE of "RBNHOLE" and "SOTAMAT" are not things we can look up location for + if self.de_call != "RBNHOLE" and self.de_call != "SOTAMAT": # DE operator position lookup, using QRZ.com. if self.de_call and not self.de_latitude: latlon = lookup_helper.infer_latlon_from_callsign_qrz(self.de_call)