doorbuzz/presency.py

13 lines
385 B
Python
Raw Normal View History

2016-04-01 00:37:54 +02:00
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# this gives number of people present via spaceapi
# but if network down, this does not work
# better get data direct from pidor or peoplecounter
import urllib, json
url = "https://spaceapi.syn2cat.lu/status/json"
response = urllib.urlopen(url);
data = json.loads(response.read())
print data["sensors"]["people_now_present"][0]["value"]