-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpillHandler.py
33 lines (29 loc) · 945 Bytes
/
pillHandler.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import requests
import time
def url_decifer(instruction):
x = (instruction.split("/")[3]).split("_")
pills = int(x[0])
container = int(x[1])
if container == 1:
for i in range(pills):
URL = "http://192.168.1.174/cont1"
requests.post(url = URL)
time.sleep(2)
elif container == 2:
for i in range(pills):
URL = "http://192.168.1.174/cont2"
requests.post(url = URL)
time.sleep(2)
elif container == 3:
for i in range(pills):
URL = "http://192.168.1.174/cont3"
requests.post(url = URL)
time.sleep(2)
else:
for i in range(pills):
URL = "http://192.168.1.174/cont4"
requests.post(url = URL)
time.sleep(2)
#URL = "http://192.168.1.174/1_3?"
#url_decifer("http://192.168.1.174/2_2")
#r = requests.post(url = URL)