5 Commits

Author SHA1 Message Date
Ian Renton
cf46017917 Fix WOTA parsing bug 2025-11-12 17:40:24 +00:00
Ian Renton
c30e1616d3 Image-based flags 2025-11-11 06:30:17 +00:00
Ian Renton
422c917073 Docs tweak 2025-11-10 19:30:40 +00:00
Ian Renton
cad1f5cfdf Defensive coding fix 2025-11-10 19:03:12 +00:00
Ian Renton
78f8cd26f0 Possible emoji flag fix for Windows/Chrome 2025-11-10 19:01:25 +00:00
410 changed files with 95 additions and 65 deletions

View File

@@ -4,7 +4,7 @@ from data.sig import SIG
# General software # General software
SOFTWARE_NAME = "Spothole by M0TRT" SOFTWARE_NAME = "Spothole by M0TRT"
SOFTWARE_VERSION = "1.0" SOFTWARE_VERSION = "1.0.1"
# HTTP headers used for spot providers that use HTTP # HTTP headers used for spot providers that use HTTP
HTTP_HEADERS = {"User-Agent": SOFTWARE_NAME + ", v" + SOFTWARE_VERSION + " (operated by " + SERVER_OWNER_CALLSIGN + ")"} HTTP_HEADERS = {"User-Agent": SOFTWARE_NAME + ", v" + SOFTWARE_VERSION + " (operated by " + SERVER_OWNER_CALLSIGN + ")"}

View File

@@ -5,7 +5,6 @@ import pytz
from core.cache_utils import SEMI_STATIC_URL_DATA_CACHE from core.cache_utils import SEMI_STATIC_URL_DATA_CACHE
from core.constants import HTTP_HEADERS from core.constants import HTTP_HEADERS
from core.sig_utils import get_icon_for_sig
from data.sig_ref import SIGRef from data.sig_ref import SIGRef
from data.spot import Spot from data.spot import Spot
from spotproviders.http_spot_provider import HTTPSpotProvider from spotproviders.http_spot_provider import HTTPSpotProvider
@@ -51,7 +50,7 @@ class GMA(HTTPSpotProvider):
# spots come through with reftype=POTA or reftype=WWFF. SOTA is harder to figure out because both SOTA # spots come through with reftype=POTA or reftype=WWFF. SOTA is harder to figure out because both SOTA
# and GMA summits come through with reftype=Summit, so we must check for the presence of a "sota" entry # and GMA summits come through with reftype=Summit, so we must check for the presence of a "sota" entry
# to determine if it's a SOTA summit. # to determine if it's a SOTA summit.
if ref_info["reftype"] not in ["POTA", "WWFF"] and (ref_info["reftype"] != "Summit" or ref_info["sota"] == ""): if "reftype" in ref_info and ref_info["reftype"] not in ["POTA", "WWFF"] and (ref_info["reftype"] != "Summit" or ref_info["sota"] == ""):
match ref_info["reftype"]: match ref_info["reftype"]:
case "Summit": case "Summit":
spot.sig_refs[0].sig = "GMA" spot.sig_refs[0].sig = "GMA"

View File

@@ -1,9 +1,10 @@
import logging
import re
from datetime import datetime from datetime import datetime
import pytz import pytz
from rss_parser import RSSParser from rss_parser import RSSParser
from core.sig_utils import get_icon_for_sig
from data.sig_ref import SIGRef from data.sig_ref import SIGRef
from data.spot import Spot from data.spot import Spot
from spotproviders.http_spot_provider import HTTPSpotProvider from spotproviders.http_spot_provider import HTTPSpotProvider
@@ -12,7 +13,7 @@ from spotproviders.http_spot_provider import HTTPSpotProvider
# Spot provider for Wainwrights on the Air # Spot provider for Wainwrights on the Air
class WOTA(HTTPSpotProvider): class WOTA(HTTPSpotProvider):
POLL_INTERVAL_SEC = 120 POLL_INTERVAL_SEC = 120
SPOTS_URL = "https://www.wota.org.uk/spots_rss.php" SPOTS_URL = "http://127.0.0.1:8000/spots_rss.php"
LIST_URL = "https://www.wota.org.uk/mapping/data/summits.json" LIST_URL = "https://www.wota.org.uk/mapping/data/summits.json"
RSS_DATE_TIME_FORMAT = "%a, %d %b %Y %H:%M:%S %z" RSS_DATE_TIME_FORMAT = "%a, %d %b %Y %H:%M:%S %z"
@@ -25,6 +26,7 @@ class WOTA(HTTPSpotProvider):
# Iterate through source data # Iterate through source data
for source_spot in rss.channel.items: for source_spot in rss.channel.items:
try:
# Reject GUID missing or zero # Reject GUID missing or zero
if not source_spot.guid or not source_spot.guid.content or source_spot.guid.content == "http://www.wota.org.uk/spots/0": if not source_spot.guid or not source_spot.guid.content or source_spot.guid.content == "http://www.wota.org.uk/spots/0":
continue continue
@@ -43,16 +45,16 @@ class WOTA(HTTPSpotProvider):
# Pick apart the description # Pick apart the description
desc_split = source_spot.description.split(". ") desc_split = source_spot.description.split(". ")
freq_mode = desc_split[0].replace("Frequencies/modes:", "").strip() freq_mode = desc_split[0].replace("Frequencies/modes:", "").strip()
freq_mode_split = freq_mode.split("-") freq_mode_split = re.split(r'[\-\s]+', freq_mode)
freq_hz = float(freq_mode_split[0]) * 1000000 freq_hz = float(freq_mode_split[0]) * 1000000
mode = freq_mode_split[1] mode = freq_mode_split[1].upper()
comment = None comment = None
if len(desc_split) > 1: if len(desc_split) > 1:
comment = desc_split[1].strip() comment = desc_split[1].strip()
spotter = None spotter = None
if len(desc_split) > 2: if len(desc_split) > 2:
spotter = desc_split[2].replace("Spotted by ", "").replace(".", "").strip() spotter = desc_split[2].replace("Spotted by ", "").replace(".", "").upper().strip()
time = datetime.strptime(source_spot.pub_date.content, self.RSS_DATE_TIME_FORMAT).astimezone(pytz.UTC) time = datetime.strptime(source_spot.pub_date.content, self.RSS_DATE_TIME_FORMAT).astimezone(pytz.UTC)
@@ -68,4 +70,6 @@ class WOTA(HTTPSpotProvider):
time=time.timestamp()) time=time.timestamp())
new_spots.append(spot) new_spots.append(spot)
except Exception as e:
logging.error("Exception parsing WOTA spot", e)
return new_spots return new_spots

View File

@@ -532,7 +532,7 @@ paths:
example: England example: England
flag: flag:
type: string type: string
description: Country flag of the operator. This is limited to the range of emoji flags, and for many DXCCs there will not be a flag, e.g. Northern Ireland. Many DXCCs may also have the same flag, e.g. mainland Spain, Balearic Islands, etc. description: Country flag of the operator. This is limited to the range of emoji flags. For some DXCCs there may not be an official emoji flag, e.g. Northern Ireland, so the appearance may vary depending on your browser and operating system. Some small islands may also have no flag. Many DXCCs may also share a flag, e.g. mainland Spain, Balearic Islands, etc.
example: "" example: ""
continent: continent:
type: string type: string
@@ -763,7 +763,7 @@ components:
example: England example: England
dx_flag: dx_flag:
type: string type: string
description: Country flag of the DX operator. This is limited to the range of emoji flags, and for many DXCCs there will not be a flag, e.g. Northern Ireland. Many DXCCs may also have the same flag, e.g. mainland Spain, Balearic Islands, etc. description: Country flag of the DX operator. This is limited to the range of emoji flags. For some DXCCs there may not be an official emoji flag, e.g. Northern Ireland, so the appearance may vary depending on your browser and operating system. Some small islands may also have no flag. Many DXCCs may also share a flag, e.g. mainland Spain, Balearic Islands, etc.
example: "" example: ""
dx_continent: dx_continent:
type: string type: string
@@ -830,7 +830,7 @@ components:
example: England example: England
de_flag: de_flag:
type: string type: string
description: Country flag of the spotter. This is limited to the range of emoji flags, and for many DXCCs there will not be a flag, e.g. Northern Ireland. Many DXCCs may also have the same flag, e.g. mainland Spain, Balearic Islands, etc. description: Country flag of the spotter. This is limited to the range of emoji flags. For some DXCCs there may not be an official emoji flag, e.g. Northern Ireland, so the appearance may vary depending on your browser and operating system. Some small islands may also have no flag. Many DXCCs may also share a flag, e.g. mainland Spain, Balearic Islands, etc.
example: "" example: ""
de_continent: de_continent:
type: string type: string
@@ -1054,7 +1054,7 @@ components:
example: England example: England
dx_flag: dx_flag:
type: string type: string
description: Country flag of the DX operator. This is limited to the range of emoji flags, and for many DXCCs there will not be a flag, e.g. Northern Ireland. Many DXCCs may also have the same flag, e.g. mainland Spain, Balearic Islands, etc. description: Country flag of the DX operator. This is limited to the range of emoji flags. For some DXCCs there may not be an official emoji flag, e.g. Northern Ireland, so the appearance may vary depending on your browser and operating system. Some small islands may also have no flag. Many DXCCs may also share a flag, e.g. mainland Spain, Balearic Islands, etc.
example: "" example: ""
dx_continent: dx_continent:
type: string type: string

View File

@@ -71,11 +71,16 @@ td.nowrap, span.nowrap {
span.flag-wrapper { span.flag-wrapper {
display: inline-block; display: inline-block;
width: 1.7em; width: 1.8em;
text-align: center; text-align: center;
cursor: default; cursor: default;
} }
img.flag {
position: relative;
top: -2px;
}
span.band-bullet { span.band-bullet {
display: inline-block; display: inline-block;
cursor: default; cursor: default;

BIN
webassets/img/flags/1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
webassets/img/flags/10.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

BIN
webassets/img/flags/100.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
webassets/img/flags/101.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

BIN
webassets/img/flags/102.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

BIN
webassets/img/flags/103.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

BIN
webassets/img/flags/104.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
webassets/img/flags/105.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
webassets/img/flags/106.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

BIN
webassets/img/flags/107.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
webassets/img/flags/108.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

BIN
webassets/img/flags/109.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

BIN
webassets/img/flags/11.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
webassets/img/flags/110.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
webassets/img/flags/111.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

BIN
webassets/img/flags/112.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
webassets/img/flags/113.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

BIN
webassets/img/flags/114.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

BIN
webassets/img/flags/115.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

BIN
webassets/img/flags/116.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

BIN
webassets/img/flags/117.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

BIN
webassets/img/flags/118.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
webassets/img/flags/119.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

BIN
webassets/img/flags/12.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

BIN
webassets/img/flags/120.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

BIN
webassets/img/flags/122.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

BIN
webassets/img/flags/123.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
webassets/img/flags/124.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

BIN
webassets/img/flags/125.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
webassets/img/flags/126.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
webassets/img/flags/127.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

BIN
webassets/img/flags/128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

BIN
webassets/img/flags/129.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
webassets/img/flags/13.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
webassets/img/flags/130.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

BIN
webassets/img/flags/131.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

BIN
webassets/img/flags/132.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

BIN
webassets/img/flags/133.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

BIN
webassets/img/flags/134.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

BIN
webassets/img/flags/135.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

BIN
webassets/img/flags/136.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
webassets/img/flags/137.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

BIN
webassets/img/flags/138.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
webassets/img/flags/139.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

BIN
webassets/img/flags/14.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

BIN
webassets/img/flags/140.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

BIN
webassets/img/flags/141.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
webassets/img/flags/142.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
webassets/img/flags/143.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
webassets/img/flags/144.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
webassets/img/flags/145.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

BIN
webassets/img/flags/146.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
webassets/img/flags/147.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

BIN
webassets/img/flags/148.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

BIN
webassets/img/flags/149.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

BIN
webassets/img/flags/15.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
webassets/img/flags/150.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

BIN
webassets/img/flags/151.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

BIN
webassets/img/flags/152.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

BIN
webassets/img/flags/153.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

BIN
webassets/img/flags/154.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

BIN
webassets/img/flags/155.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

BIN
webassets/img/flags/157.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
webassets/img/flags/158.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

BIN
webassets/img/flags/159.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
webassets/img/flags/16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

BIN
webassets/img/flags/160.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
webassets/img/flags/161.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

BIN
webassets/img/flags/162.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

BIN
webassets/img/flags/163.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

BIN
webassets/img/flags/164.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

BIN
webassets/img/flags/165.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
webassets/img/flags/166.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
webassets/img/flags/167.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

BIN
webassets/img/flags/168.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

BIN
webassets/img/flags/169.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
webassets/img/flags/17.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

BIN
webassets/img/flags/170.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

BIN
webassets/img/flags/171.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

BIN
webassets/img/flags/172.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
webassets/img/flags/173.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

BIN
webassets/img/flags/174.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
webassets/img/flags/175.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
webassets/img/flags/176.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
webassets/img/flags/177.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
webassets/img/flags/178.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

BIN
webassets/img/flags/179.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

BIN
webassets/img/flags/18.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
webassets/img/flags/180.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

BIN
webassets/img/flags/181.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

BIN
webassets/img/flags/182.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
webassets/img/flags/183.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

BIN
webassets/img/flags/184.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

BIN
webassets/img/flags/185.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

BIN
webassets/img/flags/186.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

Some files were not shown because too many files have changed in this diff Show More