Skip to content

Instantly share code, notes, and snippets.

View Jxck-S's full-sized avatar
🏠
Working from home

Jack Sweeney Jxck-S

🏠
Working from home
  • Student
  • Orlando Florida
View GitHub Profile
@Jxck-S
Jxck-S / AAInflight.py
Created March 8, 2022 04:02
AAInflight Mini Status Program
import requests
import time
from geopy.distance import geodesic
last_coords = None
speed = None
time_btwn_change = 1
check_freq = 10
#https://server.ad.logic-prod.viasat.io/afr.php?zoneid=95&parameters=%7B%22origin%22:%22KMCO%22,%22destination%22:%22KDFW%22%7D&fid=N132AN-KMCO-KDFW-2022-03-05T01:56:12Z&fleetType=&isUSDomestic=true&guid=6f3003e9-9c27-11ec-927e-06df78a0305b&subtag=&source=https:%2F%2Fwww.aainflight.com%2F&origin=https:%2F%2Fwww.aainflight.com&li=0
#https://www.aainflight.com/iptv/channelList
#https://www.aainflight.com/iptv/programGuide/grid?channelId=12%2C13%2C14%2C15%2C16%2C17%2C19%2C24%2C26%2C27%2C34%2C35&startDateTime=20220305T0300Z&endDateTime=20220305T0700Z
@Jxck-S
Jxck-S / aircraft_type_fuel_consumption_rate.json
Last active July 5, 2023 09:08
Fuel consumption rates by ICAO type of aircraft
{
"EA50": {
"name": "Eclipse 550",
"galph": 76,
"category": "VLJ"
},
"LJ31": {
"name": "Learjet 31",
"galph": 202,
"category": "Light"
@Jxck-S
Jxck-S / acas.json
Created April 7, 2021 00:00
ADSBExchange ACAS List of JSONs of a single aircraft
{"hex":"abc515","type":"adsb_icao","flight":"ENY3725 ","r":"N858AE","t":"E135","alt_baro":11150,"alt_geom":11550,"gs":268.0,"track":44.24,"baro_rate":-1024,"squawk":"5237","emergency":"none","category":"A2","lat":32.660910,"lon":-97.306469,"nic":8,"rc":186,"seen_pos":0.3,"version":2,"nic_baro":1,"nac_p":9,"nac_v":1,"sil":3,"sil_type":"perhour","gva":2,"sda":2,"alert":0,"spi":0,"mlat":[],"tisb":[],"messages":45207249,"seen":0.0,"rssi":-6.4,"acas_ra":{"utc":"2021-04-05 00:07:16.0","unix_timestamp":1617581236.02,"df_type":17,"bytes":"E2C00006A9DFE4","ARA":"1100000","RAT":"0","MTE":"0","RAC":"0000","advisory_complement":"","advisory":"Level Off","TTI":"01","threat_id_hex":"aa77f9"}}
{"hex":"abc515","type":"adsb_icao","flight":"ENY3725 ","r":"N858AE","t":"E135","alt_baro":11125,"alt_geom":11525,"gs":268.0,"track":44.24,"baro_rate":-1088,"squawk":"5237","emergency":"none","category":"A2","lat":32.662354,"lon":-97.304787,"nic":8,"rc":186,"seen_pos":0.3,"version":2,"nic_baro":1,"nac_p":9,"nac_v":1,"sil":3,"sil_type":
@Jxck-S
Jxck-S / closest_airport_openflights.py
Created March 8, 2021 01:17
Gets the closest airport from a coordinate using OpenFlights airports.dat
def get_closest_airport(latitude, longitude):
import csv
from geopy.distance import geodesic
plane = (latitude, longitude)
header = ["id", "name", "city", "country", "iata", "icao", "lat", "lng", "alt", "tz", "dst", "tz_db", "type", "source"]
with open('airports.dat', encoding='utf-8') as airport_dat:
airport_dat_reader = csv.DictReader(filter(lambda row: row[0]!='#', airport_dat), header)
for airport in airport_dat_reader:
airport_coord = float(airport['lat']), float(airport['lng'])
airport_dist = float((geodesic(plane, airport_coord).mi))
@Jxck-S
Jxck-S / ADSBXv1Response.json
Last active March 12, 2021 03:04
ADS-B Exchange v1 Single AC API Response / VRS Format
{
"ac": [
{
"postime": "1615518192631",
"icao": "AA733B",
"reg": "N7723E",
"type": "B737",
"wtc": "2",
"spd": "426.8",
"altt": "0",
@Jxck-S
Jxck-S / ADSBXv2Response.json
Created December 24, 2020 04:15
Example Response of ADS-B Exchange v2 API
{
"ac": [
{
"hex": "a2fcf2",
"type": "adsb_icao",
"flight": "ASA541 ",
"r": "N292AK",
"t": "B739",
"alt_baro": 5400,
"alt_geom": 5650,
@Jxck-S
Jxck-S / defAirportAPI.py
Last active October 26, 2020 02:37
Lookup Nearest API Wrapper/Function by cords using OutAirport API
#GET KEY AND HOST FROM https://rapidapi.com/sujayvsarma/api/ourairport-data-search?endpoint=apiendpoint_157e1886-2798-46cf-83e6-b71c2cb76273
def getAirport(latitude, longitude):
print(latitude, longitude)
import requests
import json
url = "https://ourairport-data-search.p.rapidapi.com/nearest/" + str(latitude) + "," + str(longitude)
querystring = {"maxResults":"1"}
headers = {
@Jxck-S
Jxck-S / GoogleMapNearestAirport.py
Last active March 3, 2023 09:45
Lookup nearest airport from coordinates using Google Maps. Not a very good way much better options and better data.
#Scraped this for airports.dat from https://openflights.org/data.html use haversine formula to calculate distance from each airport, lowest is closest.
#Or use https://rapidapi.com/sujayvsarma/api/ourairport-data-search?endpoint=apiendpoint_157e1886-2798-46cf-83e6-b71c2cb76273 from https://ourairports.com/data/
import googlemaps
import json
import configparser
config = configparser.ConfigParser()
config.read('config.ini')
def getAirport(rank_by, latitude, longitude):
nrby_key = config.get('GOOGLE', 'NEARBYSEARCHKEY')
@Jxck-S
Jxck-S / PyDocu.py
Created October 11, 2020 00:25
Basic Python Examples
#Basic Print string
print ('something')
#Setting Variable
age = 25
#Print variable and string
print (age, 'add')
#basic input
age = input('Enter your age: ')
#convert variable to int or float
age_int = int(age)
@Jxck-S
Jxck-S / BlockGGDomains.txt
Last active February 3, 2020 01:28
Block Goguadrdian
@@||Goguadrdian.com