I found myself poking at the POTA APIs yesterday and decided that it’d be neat to bang out a quick script that might tell me from a CLI (or over my Mac notifications) whether or not a state that I’m hunting on FT8 is on the air. The API is simple enough. So why not?
I quickly installed Python (not sure why it wasn’t on my Mac anymore, but…OK?) and did a bit of reading on the JSON library. Pretty simple. With a timeline of 20 free minutes, I banged out the following:
import json
import requests
import os
response = requests.get("https://api.pota.app/spot/activator")
spots = json.loads(response.text)
my_targets = ["US-DE", "US-HI", "US-ID", "US-LA", "US-VT"]
for spot in spots:
if spot["mode"] == "FT8":
if spot["locationDesc"] in my_targets:
my_cmd = """osascript -e 'display notification \"""" + spot["locationDesc"] + """\" with title \"GOT A LIVE ONE!\"'"""
os.system(my_cmd)
print('')
print('***********************************************')
print('*** ' + spot["activator"] +' - ' + spot["mode"] + ' - ' + spot["locationDesc"] + ' - ' + spot["reference"] + ' - ' + spot["frequency"])
print('***********************************************')
print('')
else:
print(spot["activator"] + ' - ' + spot["locationDesc"])
A few things to note. my_targets aren’t the same as anyone else’s. I’m just banging away trying to get Delaware, Hawaii, Idaho, Louisiana, and Vermont. The targets could really be anything anywhere. So that’s neat. I can switch that up and poke around if I’m trying to find some rare DX.
Another thing to note is that Alaska isn’t in my_targets because as soon as I’d finished the script, it found that a station in Alaska at Quartz Lake State Recreation Area – K-7237 was on 10m and I nabbed him! Thanks KL7AC!
This script is not particularly well tested and the osascript piece will only work on a Mac. But the rest of it? It could be dumped into a cron job (my plan) and used to message someone (maybe).
I’m sure there are better tools for this. I’m also sure that I didn’t really spend any time looking for them because I had 20 minutes and an itch to solve this while it was in front of me. Probably not gonna put this up on Git but I will leave it here.
1 thought on “Simple POTA Hunter Script”
Comments are closed.