diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d74d3df --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +bin/ +lib/ +lib64 +pyvenv.cfg +share/ +status.json diff --git a/generate.py b/generate.py new file mode 100644 index 0000000..465aa44 --- /dev/null +++ b/generate.py @@ -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)) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..663bd1f --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +requests \ No newline at end of file diff --git a/status.json b/status.json deleted file mode 100644 index 7144d16..0000000 --- a/status.json +++ /dev/null @@ -1 +0,0 @@ -{"space": "ChaosZone", "url": "https://chaoszone.cz", "issue_report_channels": ["email"], "contact": {"email": "chaoszone@eigenbaukombinat.de"}, "state": {"open": false, "icon": {"open": "", "closed": ""}}, "api": "0.13", "location": {"lat": 0, "lon": 0, "address": "Eastside"}, "logo": "https://cfp.chaoszone.cz/media/csr20/img/chaoszone.png", "feeds": {"calendar": {"url": "https://raw.githubusercontent.com/chaosz0ne/spaceapi/master/chaoszone.ics", "type": "ical"}}} diff --git a/status.json.in b/status.json.in new file mode 100644 index 0000000..2340149 --- /dev/null +++ b/status.json.in @@ -0,0 +1,17 @@ +{ +"space": "ChaosZone", +"url": "https://chaoszone.cz", +"issue_report_channels": ["email"], +"contact": { + "email": "chaoszone@eigenbaukombinat.de"}, +"state": { + "open": false, "icon": {"open": "", "closed": ""}}, +"api": "0.13", +"location": { + "lat": %s, "lon": %s, "address": "Eastside"}, +"logo": "https://cfp.chaoszone.cz/media/csr20/img/chaoszone.png", +"feeds": { + "calendar": { + "url": "https://raw.githubusercontent.com/chaosz0ne/spaceapi/master/chaoszone.ics", + "type": "ical"}} +}