auckland university computers
exploring the auckland university SIT API
In [6]:
import requests
import json
In [3]:
labreqmach = requests.get('http://www.fos.auckland.ac.nz/api/lab/machines/1.json')
In [8]:
labmachdic = json.loads(labreqmach.text)
In [12]:
lenmach = len(labmachdic)
In [15]:
labmachdic[lenmach]
In [28]:
for labm in range(0, lenmach):
print(labmachdic[labm]['ip'])
In [29]:
labdet = requests.get('http://www.fos.auckland.ac.nz/api/lab/current_usage/1.json')
In [31]:
labdet.text
Out[31]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [25]:
for labm in range(0, lenmach):
print(labmachdic[labm]['in_use'])
#if True in (labmachdic[labm]['in_use']):
# print(labmachdic[labm]['in_use'])
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]: