Merge branch 'main' into 97-wwtota

This commit is contained in:
Ian Renton
2026-01-22 19:00:59 +00:00
2 changed files with 25 additions and 23 deletions

View File

@@ -20,29 +20,31 @@ class BOTA(HTTPAlertProvider):
new_alerts = [] new_alerts = []
# Find the table of upcoming alerts # Find the table of upcoming alerts
bs = BeautifulSoup(http_response.content.decode(), features="lxml") bs = BeautifulSoup(http_response.content.decode(), features="lxml")
forthcoming_activations_div = bs.body.find('div', attrs={'class': 'view-activations-public'}) div = bs.body.find('div', attrs={'class': 'view-activations-public'})
if forthcoming_activations_div: if div:
tbody = forthcoming_activations_div.find('table', attrs={'class': 'views-table'}).find('tbody') table = div.find('table', attrs={'class': 'views-table'})
for row in tbody.find_all('tr'): if table:
cells = row.find_all('td') tbody = table.find('tbody')
first_cell_text = str(cells[0].find('a').contents[0]).strip() for row in tbody.find_all('tr'):
ref_name = first_cell_text.split(" by ")[0] cells = row.find_all('td')
dx_call = str(cells[1].find('a').contents[0]).strip().upper() first_cell_text = str(cells[0].find('a').contents[0]).strip()
ref_name = first_cell_text.split(" by ")[0]
dx_call = str(cells[1].find('a').contents[0]).strip().upper()
# Get the date, dealing with the fact we get no year so have to figure out if it's last year or next year # Get the date, dealing with the fact we get no year so have to figure out if it's last year or next year
date_text = str(cells[2].find('span').contents[0]).strip() date_text = str(cells[2].find('span').contents[0]).strip()
date_time = datetime.strptime(date_text,"%d %b - %H:%M UTC").replace(tzinfo=pytz.UTC) date_time = datetime.strptime(date_text,"%d %b - %H:%M UTC").replace(tzinfo=pytz.UTC)
date_time = date_time.replace(year=datetime.now(pytz.UTC).year) date_time = date_time.replace(year=datetime.now(pytz.UTC).year)
# If this was more than a day ago, activation is actually next year # If this was more than a day ago, activation is actually next year
if date_time < datetime.now(pytz.UTC) - timedelta(days=1): if date_time < datetime.now(pytz.UTC) - timedelta(days=1):
date_time = date_time.replace(year=datetime.now(pytz.UTC).year + 1) date_time = date_time.replace(year=datetime.now(pytz.UTC).year + 1)
# Convert to our alert format # Convert to our alert format
alert = Alert(source=self.name, alert = Alert(source=self.name,
dx_calls=[dx_call], dx_calls=[dx_call],
sig_refs=[SIGRef(id=ref_name, sig="BOTA")], sig_refs=[SIGRef(id=ref_name, sig="BOTA")],
start_time=date_time.timestamp(), start_time=date_time.timestamp(),
is_dxpedition=False) is_dxpedition=False)
new_alerts.append(alert) new_alerts.append(alert)
return new_alerts return new_alerts

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.2-pre" SOFTWARE_VERSION = "1.2"
# 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 + ")"}