- Check space API if open and how many ppl inside

master
Steve Clement 2015-03-01 17:29:34 +01:00
commit 7a563de545
1 changed files with 15 additions and 0 deletions

15
main.py Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env python3
import requests
import json
r = requests.get('https://spaceapi.syn2cat.lu/status/json')
obj = json.loads(r.text)
presence = obj["sensors"]["people_now_present"][0]["value"]
if obj["state"]["open"]:
print("And we are open!")
print("There are {} Hackers present NOW!".format(presence))