aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)