-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version 0.1 (DEVELOPER RELEASE) - The "brain" of the project, soon to…
… add documentation and etc.
- Loading branch information
1 parent
cf515fe
commit b52b7f7
Showing
4 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
# email-alias-generator | ||
Documentation and how-to comming soon... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |