Improve submit script
This commit is contained in:
parent
0aece8b8ca
commit
bc78ac5775
1 changed files with 8 additions and 5 deletions
13
submit.py
Normal file → Executable file
13
submit.py
Normal file → Executable file
|
@ -1,10 +1,12 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import json
|
||||
import requests
|
||||
import time
|
||||
|
||||
|
||||
|
||||
|
||||
SERVER = os.getenv("LEDSTRIP_SERVER", "http://10.1.0.212:8080")
|
||||
|
||||
|
||||
for i in range(10):
|
||||
|
@ -13,11 +15,12 @@ for i in range(10):
|
|||
c = codefile.read()
|
||||
except:
|
||||
continue
|
||||
j = {
|
||||
|
||||
payload = {
|
||||
"code": c,
|
||||
"owner": "j",
|
||||
"id": i
|
||||
}
|
||||
r = requests.put('http://10.1.0.212:8080/api/code.json', json=j)
|
||||
r = requests.put(SERVER + '/api/code.json', json=payload)
|
||||
print(r)
|
||||
print(r.text)
|
||||
print(r.text)
|
||||
|
|
Loading…
Reference in a new issue