I have the same issue with WestJet flights. I used an if statement to check for alpha characters, if there are none I prepend WJA to the flight number for the FlightAware link. For your situation you would prepend SWA. So far, it has worked out well, and all the flights that only contain numbers are indeed WestJet flights that are tracked in my coverage zone in accordance to my pi’s readings.
You can edit the script.js file in the dump1090/public_html file to include it.
Traverse to the directory:
cd /usr/share/dump1090/public_html/
Open up the editor with script.js:
sudo vi script.js
Travel down the file with page down until you come up to the line that says
html += ' <a href="http://flightaware.com/live/flight/'+selected.flight+'" target="_blank">[FlightAware]</a>';
Type the letter “i” to get into “INSERT” mode, you should see “-- INSERT --” at the bottom left of your screen.
Change the file to look like this:
if (!selected.flight.match(/[a-z]/i)){
html += ' <a href="http://flightaware.com/live/flight/SWA'+selected.flight+'" target="_blank">[FlightAware]</a>';
}
else{
html += ' <a href="http://flightaware.com/live/flight/'+selected.flight+'" target="_blank">[FlightAware]</a>';
}
Push the escape key, then type:
:wq!
That will save and quit the editor.
Go to your webpage and reload it. Now the flight number will show up in the list with just the numbers, but if you click on the FlightAware link at the top, it will add the SWA to the link and bring you to the proper flight.
There is also a way to change it in the table, I can post that if you would like.
Hope this helps.