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:
parent
9605a20e22
commit
d9828405ba
5 changed files with 37 additions and 1 deletions
13
generate.py
Normal file
13
generate.py
Normal 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))
|
Loading…
Add table
Add a link
Reference in a new issue