aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2024-03-08 03:08:32 +0530
committerLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2024-03-08 03:08:32 +0530
commit0075c11b6f1c54c45fb0c6516056484d4ea3a42f (patch)
tree64a475f8478323bd83a136aa40f7308cd49e8bdb
parent994399bbfd72dd09db9bcf738ecdd245376a7a4e (diff)
downloadcrypto-alert-0075c11b6f1c54c45fb0c6516056484d4ea3a42f.tar.gz
crypto-alert-0075c11b6f1c54c45fb0c6516056484d4ea3a42f.tar.bz2
crypto-alert-0075c11b6f1c54c45fb0c6516056484d4ea3a42f.zip
securing email and pass
-rw-r--r--main.py28
1 files changed, 19 insertions, 9 deletions
diff --git a/main.py b/main.py
index d95796d..2ba2677 100644
--- a/main.py
+++ b/main.py
@@ -23,9 +23,19 @@ def price():
def email(btc):
# change the email address or create a email.txt file and put your email there
- sender_email = open('email.txt', 'r')
+ with open('email.txt', 'r') as file:
+ lines = [line.strip() for line in file]
+
+ for line in lines:
+ sender_email = line
+
# do the same with password
- sender_password = open('pass.txt', 'r')
+ with open('pass.txt', 'r') as file:
+ lines = [line.strip() for line in file]
+
+ for line in lines:
+ sender_password = line
+
# change your email to something else the alert will be send to there
receiver_email = "biswa@dmc.chat"
@@ -42,15 +52,15 @@ def email(btc):
def check():
btc_price = price()
- alert = input("enter the alert number you want: ")
- print(alert)
+ alert = int(input("enter the alert number you want: "))
- if btc_price == alert:
+ if btc_price > alert:
email(btc_price)
print(f"Alert! BTC price is {btc_price} USD. Email sent.")
-schedule.every().hour.do(check)
+check()
+# schedule.every().hour.do(check)
-while True:
- schedule.run_pending()
- time.sleep(1)
+# while True:
+# schedule.run_pending()
+# time.sleep(1)