From 03ffeaadaf8f28834aeba132b5bb49a147255ab4 Mon Sep 17 00:00:00 2001 From: randomuser Date: Wed, 13 Jul 2022 18:28:23 -0500 Subject: [PATCH] add some random crap --- etc/southwest_tracker.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 etc/southwest_tracker.py diff --git a/etc/southwest_tracker.py b/etc/southwest_tracker.py new file mode 100644 index 0000000..2cf2258 --- /dev/null +++ b/etc/southwest_tracker.py @@ -0,0 +1,26 @@ +import httplib2 +import json +import math +import time + +# fun fact: i got bored so made this on a southwest flight + +while True: + request = httplib2.Http() + # you have to look in the network tab in 'inspect element', and find the '_' parameter, and paste that in + # of course, you have to be connected to southwest's onboard wifi + _param = "fill this in" + data = request.request("https://getconnected.southwestwifi.com/fp3d_fcgi-php/portal/public/index.php?_url=/index/getFile&path=last&_=" + _param) + data = json.loads(data[1]) + print("-- Update --") + print("Nautical Miles: " + str(data["distanceToDestinationNauticalMiles"])) + print("Phase: " + data["presentPhase"]) + print("Speed: " + str(data["groundSpeedKnots"]) + "kts") + seconds = data['timeToDestination'] + minutes = math.floor(seconds / 60) + seconds = seconds % 60 + print("Minutes: " + str(minutes) + " Seconds: " + str(seconds)) + print("Flight Number: " + data["flightNumber"] + " Registration: " + data["tailNumber"]) + + time.sleep(3) + print('\033[H\033[2J')