You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

15 lines
359 B

import requests
import time
import json
import sys
road = int(sys.argv[1])
res = requests.get("http://cloud_computing_project_api:8080/traffic_lights/subscribe?road=" + str(road))
ID = json.loads(res.text)["insertedId"]
while True:
res = requests.get("http://cloud_computing_project_api:8080/traffic_lights/read?id=" + str(ID))
time.sleep(1)