-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmatchdata.py
More file actions
30 lines (23 loc) · 830 Bytes
/
Copy pathmatchdata.py
File metadata and controls
30 lines (23 loc) · 830 Bytes
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
import requests
import json
url = "https://simnba.azurewebsites.net/api/"
# url = "http://localhost:8081/"
def GetMatchesForSimulation():
res = requests.get(url + "simbba/matches/simulation")
if res.status_code == 200:
return res.json()
return False
def GetMatchData(home, away, is_NBA):
if is_NBA == False:
res = requests.get(url + "cbb/match/data/" + home + "/" + away)
if res.status_code == 200:
return res.json()
return False
else:
res = requests.get(url + "nba/match/data/" + home + "/" + away)
if res.status_code == 200:
return res.json()
return False
def SendStats(dto):
obj = json.dumps(dto, default=lambda o: o.__dict__, sort_keys=True, indent=4)
r = requests.post(url + "admin/results/import/", data=obj)