From 7a563de545108da2e95751423ac2eeaf879ebfad Mon Sep 17 00:00:00 2001 From: Steve Clement Date: Sun, 1 Mar 2015 17:29:34 +0100 Subject: [PATCH] - Check space API if open and how many ppl inside --- main.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 main.py 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))