diff --git a/.gitignore b/.gitignore index 5d381cc..bb746ec 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +*.toml + # ---> Python # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/Apprise-Client.py b/Apprise-Client.py new file mode 100644 index 0000000..b052103 --- /dev/null +++ b/Apprise-Client.py @@ -0,0 +1,15 @@ +import requests as r +from tomllib import load + +config_file_path = './config.toml' +with open(config_file_path, 'rb') as c: + config = load(c) + +def apprise_notify(req_obj, host, port, aurls, title, body): + payload = {'urls': aurls,'title': title,'body': body,} + url = f'http://{host}:{port}/notify/' + apprise_response = req_obj.post(url, json = payload ,verify=False) + return apprise_response + +a = apprise_notify(r,config["apprise"]["host"],config["apprise"]["port"],config["apprise"]["aurls"],\ + config["apprise"]["title"],config["apprise"]["body"]) \ No newline at end of file diff --git a/config.toml.example b/config.toml.example new file mode 100644 index 0000000..12dfeed --- /dev/null +++ b/config.toml.example @@ -0,0 +1,6 @@ +[apprise] +host = "192.168.x.x" +port = 8088 +aurls = 'mailto://user:pass@gmail.com' +title = 'test title' +body = 'test body' \ No newline at end of file