Skip to content
Snippets Groups Projects
Commit a0f3c7b3 authored by Pascal Engeler's avatar Pascal Engeler
Browse files

Added element communicator

parent f1aeeb9f
No related branches found
No related tags found
No related merge requests found
import requests
import json
with open('.secrets.json') as secrets_file:
secrets = json.load(secrets_file)
def get_secrets(setting, secrets=secrets):
try:
return secrets[setting]
except KeyError:
print("Failed to load credentials.")
class Element:
def __init__(self):
self.url = get_secrets("ELEMENT_URL")
def warn(self, message):
myobj = {"text":message,"username":"Zygote"}
try:
requests.post(self.url, json=myobj)
#print(myobj["text"])
except:
print("Failed to send message.")
\ No newline at end of file
1721723768.1442149,30.998525,25.575567,31.34614,25.994017,33.898181
\ No newline at end of file
1721723827.9444673,30.996522,25.553679,31.375976,25.895765,34.028117
\ No newline at end of file
import requests
import json
with open('.secrets.json') as secrets_file:
secrets = json.load(secrets_file)
def get_secrets(setting, secrets=secrets):
try:
return secrets[setting]
except KeyError:
print("Failed to load credentials.")
class Element:
def __init__(self):
self.url = get_secrets("ELEMENT_URL")
def warn(self, message):
myobj = {"text":message,"username":"Zygote"}
try:
requests.post(self.url, json=myobj)
#print(myobj["text"])
except:
print("Failed to send message.")
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment