I have search the forms for a way to be notified when an aircraft that I was interested in was spotted on my dump1090. I never found any code that worked for me so I wrote my own. You are welcome to use this code if you know Python. You will also need a Amazon AWS account if you wish to receive text messages.
import json
import requests
import time
import datetime
import boto3
Create an SNS client
client = boto3.client(
“sns”,
aws_access_key_id=“YourID”,
aws_secret_access_key=“YourKey”,
region_name=“us-east-1”
)
plane = [‘PlaneToTrack’, ‘PlaneToTrack’, ‘PlaneToTrack’, ‘PlaneToTrack’] #Planes that you want to track
while True:
try:
r = requests.get(‘http://192.168.1.101:8080/data/aircraft.json’) #Your URL
rData = json.loads(r.text, encoding=“utf-8”)
x = rData[“aircraft”]
y = json.dumps(x)
current_date = datetime.datetime.now().replace(microsecond=0)
for z in plane:
if z in y:
print((z), " @ “, str(current_date))
#client.publish(PhoneNumber=“YourPhoneNunumber”, Message=str(z) + (” @ ") + str(current_date))
time.sleep(30)
except:
current_date = datetime.datetime.now().replace(microsecond=0)
print(‘Failed to open url’, " @ ", str(current_date))
time.sleep(120)