Add links for QRZ.com and RadioID.net

This commit is contained in:
Marcus Kida 2026-08-17 18:06:16 +02:00
parent 2fbd529c93
commit 7e15f2adbb

10
main.py
View file

@ -120,7 +120,15 @@ def on_mqtt(data):
max_old_time = epoch_time - 20 max_old_time = epoch_time - 20
# Build the message that will be sent to Telegram # Build the message that will be sent to Telegram
telegram_message = "Callsign: <b><a href='https://brandmeister.network/#/profile/" +jsondata["SourceCall"] + "'>" + jsondata["SourceCall"] + "</a></b> ID: <b>" + str(jsondata["SourceID"]) + " </b> \nName: " +jsondata["SourceName"] + " \nTalkeralias: <b>" + jsondata["TalkerAlias"] + "</b> \n-----------------------------------\nAccess via: <b>" + jsondata["LinkName"] + " </b>\nVia repeater: <b><a href='https://brandmeister.network/#/device/" + str(jsondata["ContextID"]) + "'>" + jsondata["LinkCall"] + "</a></b>\nSlot: " + str(jsondata["Slot"]) + " TG: " + str(jsondata["DestinationID"]) + "\nMaster: " + str(jsondata["Master"]) + "\nRSSI: <b>" + str(jsondata["RSSI"]) + " dBm</b> BER: <b>" + str(round(jsondata["BER"],2)) + "%</b>" source_call = jsondata["SourceCall"].strip()
# Without a callsign there is nothing to look up, so skip the links.
links_line = (
"\nLinks: <b><a href='https://www.qrz.com/db/" + source_call + "'>QRZ.com</a></b>"
+ " <b><a href='https://radioid.net/database/view?callsign=" + source_call + "'>RadioID.net</a></b> "
if source_call
else ""
)
telegram_message = "Callsign: <b><a href='https://brandmeister.network/#/profile/" +jsondata["SourceCall"] + "'>" + jsondata["SourceCall"] + "</a></b> ID: <b>" + str(jsondata["SourceID"]) + " </b> \nName: " +jsondata["SourceName"] + " \nTalkeralias: <b>" + jsondata["TalkerAlias"] + "</b> " + links_line + "\n-----------------------------------\nAccess via: <b>" + jsondata["LinkName"] + " </b>\nVia repeater: <b><a href='https://brandmeister.network/#/device/" + str(jsondata["ContextID"]) + "'>" + jsondata["LinkCall"] + "</a></b>\nSlot: " + str(jsondata["Slot"]) + " TG: " + str(jsondata["DestinationID"]) + "\nMaster: " + str(jsondata["Master"]) + "\nRSSI: <b>" + str(jsondata["RSSI"]) + " dBm</b> BER: <b>" + str(round(jsondata["BER"],2)) + "%</b>"
context_id = _as_int(jsondata["ContextID"]) context_id = _as_int(jsondata["ContextID"])
event_slot = _as_int(jsondata["Slot"]) event_slot = _as_int(jsondata["Slot"])