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.

14 lines
649 B

import urllib3, json
http = urllib3.PoolManager()
def send(x):
http.request("POST", "", body=json.dumps({"mode": "send", "channel": "potatOS", "message": x}), headers={"Content-Type": "application/json"})
while True:
r = http.request("POST", "", body=json.dumps({"mode": "recv", "channel": "potatOS", "timeout": 30000}), headers={"Content-Type": "application/json"})
data = json.loads(
if data["result"] != None:
res = data["result"]["data"]
except Exception as e: