-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHMonitor.py
More file actions
47 lines (36 loc) · 1.2 KB
/
Copy pathHMonitor.py
File metadata and controls
47 lines (36 loc) · 1.2 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# pip install playsound
import time
import requests
from playsound import playsound
url = 'https://example.com'
headers = {"accept": "application/json, text/javascript, */*; q=0.01",
"accept-language": "en-US,en;q=0.9",
"sec-ch-ua": "\"Google Chrome\";v=\"95\", \"Chromium\";v=\"95\", \";Not A Brand\";v=\"99\"",
"sec-ch-ua-mobile": "?1",
"sec-ch-ua-platform": "\"Android\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"x-requested-with": "XMLHttpRequest",
"Referer": "https://learn.oracle.com/ols/exam/35644/91401/146401",
"cookie": "",
"Referrer-Policy": "strict-origin-when-cross-origin"
}
cmprTo = []
while (True):
r = requests.get(url, headers=headers, params={'tz': 'Asia/Kuwait'})
i = 0
av = r.json()['availableSlots']
topTen = []
while (i < 10):
topTen.append(av[i])
i = i + 1
if (cmprTo == []):
cmprTo = topTen
if (topTen != cmprTo):
print(topTen)
playsound('gilfoyle_alert.mp3')
cmprTo = topTen
else:
print('Unchanged \t ' + str(time.strftime('%I:%M:%S %p')))
time.sleep(20)