File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,20 +32,20 @@ def check_price():
3232 trig_point = float (input ("Input the trigger price(dollar) above at which you want to recieve mail alert: " ))
3333 else :
3434 trig_point = float (input ("Input the trigger price(dollar) below at which you want to recieve mail alert: " ))
35-
36- def send_mail ():
35+
36+ def send_mail ():
3737 server = smtplib .SMTP (mail_server , mail_port )
3838 server .ehlo ()
3939 server .starttls ()
4040 server .ehlo ()
4141 server .login (from_email , from_email_password )
4242 subject = f"{ spot_name .upper ()} EXCHANGE RATE"
43-
43+
4444 if cpolarity == 1 :
4545 body = f"{ spot_name .upper ()} Exchange is now above ${ trig_point } : Current Exchange Rate: ${ lprice } ."
4646 else :
4747 body = f"{ spot_name .upper ()} Exchange is now below ${ trig_point } : Current Exchange Rate: ${ lprice } ."
48-
48+
4949 msg = f'''Subject: { subject } \n
5050 To: { "" .join (to_email )} \n
5151 { body } '''
@@ -65,11 +65,11 @@ def send_mail():
6565 if json_list [i ]["symbol" ] == spot_name .upper ():
6666 cryptoname = json_list [i ]
6767 try :
68- lprice = float (cryptoname ["lastPrice" ])
68+ lprice = float (cryptoname ["lastPrice" ][ 4 : 6 ] )
6969 print (lprice )
7070 except ValueError :
7171 print ("This Exchange is not available." )
72-
72+
7373 if lprice >= trig_point and cpolarity == 1 :
7474 send_mail ()
7575 exit ()
You can’t perform that action at this time.
0 commit comments