commit 7a563de545108da2e95751423ac2eeaf879ebfad Author: Steve Clement Date: Sun Mar 1 17:29:34 2015 +0100 - Check space API if open and how many ppl inside diff --git a/main.py b/main.py new file mode 100755 index 0000000..2edb458 --- /dev/null +++ b/main.py @@ -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))