Skip to content

Commit

Permalink
Version 0.1 (DEVELOPER RELEASE) - The "brain" of the project, soon to…
Browse files Browse the repository at this point in the history
… add documentation and etc.
  • Loading branch information
evolvedoff authored Dec 10, 2023
1 parent cf515fe commit b52b7f7
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# email-alias-generator
Documentation and how-to comming soon...
15 changes: 15 additions & 0 deletions copier.py
Original file line number Diff line number Diff line change
@@ -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)
32 changes: 32 additions & 0 deletions generator.py
Original file line number Diff line number Diff line change
@@ -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)
12 changes: 12 additions & 0 deletions shower.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit b52b7f7

Please sign in to comment.