From 0075c11b6f1c54c45fb0c6516056484d4ea3a42f Mon Sep 17 00:00:00 2001 From: Biswakalyan Bhuyan Date: Fri, 8 Mar 2024 03:08:32 +0530 Subject: securing email and pass --- main.py | 28 +++++++++++++++++++--------- 1 file 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) -- cgit v1.2.3-59-g8ed1b