5
0
Fork 0
mirror of https://github.com/chaosz0ne/spaceapi.git synced 2025-07-06 15:53:54 +02:00

add script to generate lat & lon

This commit is contained in:
nilo 2020-11-14 16:11:45 +01:00
parent 9605a20e22
commit d9828405ba
5 changed files with 37 additions and 1 deletions

13
generate.py Normal file
View file

@ -0,0 +1,13 @@
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))