From 8899cd33bb3b140169ddbde1a034fc107e8feff7 Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Fri, 15 Sep 2023 09:05:31 +0200 Subject: [PATCH] feat(py): added sms feature --- cli/app.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cli/app.py b/cli/app.py index f9716b4..742137c 100644 --- a/cli/app.py +++ b/cli/app.py @@ -99,6 +99,9 @@ while not (command == "quit" or command == "exit" or command == "q"): elif command[0:5] == "grep ": action = "grep" command = command[5:] + elif command[0:4] == "sms ": + action = "sms" + command = command[4:] try: index = int(command) @@ -116,6 +119,9 @@ while not (command == "quit" or command == "exit" or command == "q"): if newname: note["title"] = newname savedata() + elif action == "sms": + if note and ask("send '" + note["title"] + "' by sms? "): + subprocess.call(["curl", "-s", "-X", "POST", "-F", "action=sms", "-F", "password=" + settings["password"], "-F", "data=" + urllib.parse.quote_plus(note["content"]), settings["url"] + "/handler.php"]) elif note and not action == "grep": editnote(note) else: