12345678910111213141516171819202122232425262728293031323334 |
- import requests
- import json
- members = [
- {"name": "Daniel", "id": 1466083},
- {"name": "Glenn", "id": 1512446},
- {"name": "Hannes", "id": 1395737},
- {"name": "Janus", "id": 1413802},
- {"name": "Julian", "id": 1611428},
- {"name": "Lars", "id": 1504305},
- {"name": "Luciano", "id": 1468202},
- {"name": "Manuel", "id": 1465242},
- {"name": "Pascal", "id": 1451860},
- {"name": "Tim", "id": 1342244},
- {"name": "Vincent", "id": 1463490},
- ]
- for member in members:
- url = "https://api.vatsim.net/v2/members/{}/atc?limit=100".format(member["id"])
- payload={}
- headers = {
- 'Accept': 'application/json'
- }
- response = requests.request("GET", url, headers=headers, data=payload)
- member["data"] = json.loads(response.text)
- f = open("mrzmay.json", "w")
- f.write(json.dumps(members))
- f.close()
|