From 0c31de77c951cdb9de0b03c81365ce2c39f488ae Mon Sep 17 00:00:00 2001 From: Karl Mathias Moberg Date: Fri, 3 May 2024 15:17:13 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20the=20VATSIM=20fetching=20bit?= =?UTF-8?q?.=20Whops.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.py b/main.py index 4387fa3..ea55a1e 100644 --- a/main.py +++ b/main.py @@ -120,6 +120,13 @@ def timeout_handler(signum, frame): ### PILOT BLOCK ### + +def fetch_vatsim_pilots(): + """ Fetches active pilots from VATSIM data feed. """ + response = requests.get('http://data.vatsim.net/v3/vatsim-data.json') + data = response.json() + return {pilot['cid']: pilot for pilot in data['pilots']} + def updatePilots(ts3conn, conn): """ Update pilot groups in Teamspeak based on active pilots from VATSIM.