Skip to content

Commit

Permalink
✨ Add the VATSIM fetching bit. Whops.
Browse files Browse the repository at this point in the history
  • Loading branch information
kmoberg committed May 3, 2024
1 parent 8667199 commit 0c31de7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 0c31de7

Please sign in to comment.