mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2025-10-27 08:49:27 +00:00
Extract spotter information from comments of RBNHole and SOTAMAT posts
This commit is contained in:
18
data/spot.py
18
data/spot.py
@@ -177,6 +177,20 @@ class Spot:
|
|||||||
if self.de_call and "-" in self.de_call:
|
if self.de_call and "-" in self.de_call:
|
||||||
self.de_call = self.de_call.split("-")[0]
|
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.
|
# Spotter country, continent, zones etc. from callsign.
|
||||||
# DE of "RBNHOLE" and "SOTAMAT" are not things we can look up location for
|
# DE of "RBNHOLE" and "SOTAMAT" are not things we can look up location for
|
||||||
if self.de_call != "RBNHOLE" and self.de_call != "SOTAMAT":
|
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_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)
|
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
|
# DE of "RBNHOLE" and "SOTAMAT" are not things we can look up location for
|
||||||
if self.de_call != "RBNHOLE" and self.de_call != "SOTAMAT" and self.de_call != "ZLOTA":
|
if self.de_call != "RBNHOLE" and self.de_call != "SOTAMAT":
|
||||||
# DE operator position lookup, using QRZ.com.
|
# DE operator position lookup, using QRZ.com.
|
||||||
if self.de_call and not self.de_latitude:
|
if self.de_call and not self.de_latitude:
|
||||||
latlon = lookup_helper.infer_latlon_from_callsign_qrz(self.de_call)
|
latlon = lookup_helper.infer_latlon_from_callsign_qrz(self.de_call)
|
||||||
|
|||||||
Reference in New Issue
Block a user