mrz_may.py 877 B

12345678910111213141516171819202122232425262728293031323334
  1. import requests
  2. import json
  3. members = [
  4. {"name": "Daniel", "id": 1466083},
  5. {"name": "Glenn", "id": 1512446},
  6. {"name": "Hannes", "id": 1395737},
  7. {"name": "Janus", "id": 1413802},
  8. {"name": "Julian", "id": 1611428},
  9. {"name": "Lars", "id": 1504305},
  10. {"name": "Luciano", "id": 1468202},
  11. {"name": "Manuel", "id": 1465242},
  12. {"name": "Pascal", "id": 1451860},
  13. {"name": "Tim", "id": 1342244},
  14. {"name": "Vincent", "id": 1463490},
  15. ]
  16. for member in members:
  17. url = "https://api.vatsim.net/v2/members/{}/atc?limit=100".format(member["id"])
  18. payload={}
  19. headers = {
  20. 'Accept': 'application/json'
  21. }
  22. response = requests.request("GET", url, headers=headers, data=payload)
  23. member["data"] = json.loads(response.text)
  24. f = open("mrzmay.json", "w")
  25. f.write(json.dumps(members))
  26. f.close()