diff --git a/README.md b/README.md index a191a9e..8f4578d 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -# email-alias-generator \ No newline at end of file +Documentation and how-to comming soon... \ No newline at end of file diff --git a/copier.py b/copier.py new file mode 100644 index 0000000..8cde156 --- /dev/null +++ b/copier.py @@ -0,0 +1,15 @@ +import pyperclip +from win10toast import ToastNotifier + +previousemailPath = "" # PUT THE FULL PATH OF THE TXT FILE NAMED "previousemail.txt" + +with open(previousemailPath, "r") as file: + data = file.read().rstrip() + +pyperclip.copy(data) + +text = f"The email '{data}' was copied to the clipboard." + +toaster = ToastNotifier() + +toaster.show_toast("Email Alias Service", text, icon_path=None, duration=0) diff --git a/generator.py b/generator.py new file mode 100644 index 0000000..092062c --- /dev/null +++ b/generator.py @@ -0,0 +1,32 @@ +import requests +import subprocess +from requests.structures import CaseInsensitiveDict +import json +from win10toast import ToastNotifier + +token = "" # PLACE THE TOKEN IN THE STRING +previousemailPath = "" # PUT THE FULL PATH OF THE TXT FILE NAMED "previousemail.txt" + +url = "https://quack.duckduckgo.com/api/email/addresses" + +headers = CaseInsensitiveDict() +headers["Authorization"] = f"Bearer {token}" +headers["Content-Type"] = "application/json" +headers["Content-Length"] = "0" + +resp = requests.post(url, headers=headers) + +json_bytes = resp.content +json_str = json_bytes.decode('utf-8') +data = json.loads(json_str) + +address_value = data.get("address") + +with open(previousemailPath, "w") as text_file: + text_file.write(f"{address_value}@duck.com") + +text = f"The email that was generated is: {address_value}@duck.com" + +toaster = ToastNotifier() + +toaster.show_toast("Email Alias Service", text, icon_path=None, duration=0) diff --git a/shower.py b/shower.py new file mode 100644 index 0000000..a85bc50 --- /dev/null +++ b/shower.py @@ -0,0 +1,12 @@ +from win10toast import ToastNotifier + +previousemailPath = "" # PUT THE FULL PATH OF THE TXT FILE NAMED "previousemail.txt" + +with open(previousemailPath, "r") as file: + data = file.read().rstrip() + +text = f"The currently generated email is: {data}" + +toaster = ToastNotifier() + +toaster.show_toast("Email Alias Service", text, icon_path=None, duration=0)