5
0
Fork 0
mirror of https://github.com/chaosz0ne/spaceapi.git synced 2024-06-01 22:16:22 +02:00
spaceapi_chaoszone_github/generate.py
2020-11-14 16:11:45 +01:00

13 lines
305 B
Python

import requests
with open('status.json.in') as st_in:
content = st_in.read()
obj = requests.get("http://api.open-notify.org/iss-now.json").json()
lat = obj['iss_position']['latitude']
lon = obj['iss_position']['longitude']
with open('status.json', 'w') as st_out:
st_out.write(content % (lat, lon))