You are viewing a single comment's thread from:

RE: Payment for Coding done

in #codingfund11 months ago

Main monitoring loop

while True:
current_price = get_flight_price()

if current_price < threshold_price:
    message = message_template.format('Destination', current_price)

    # Send an email notification
    try:
        server = smtplib.SMTP('smtp.gmail.com', 587)
        server.starttls()
        server.login(gmail_username, gmail_password)
        server.sendmail(sender_email, recipient_email, f'Subject: {subject}\n\n{message}')
        server.quit()
        print(f'Email notification sent for price: ${current_price}')
    except Exception as e:
        print(f'Error sending email notification: {str(e)}')

# Sleep for a specified interval (e.g., check every 1 hour)
time.sleep(3600)

Coin Marketplace

STEEM 0.20
TRX 0.13
JST 0.029
BTC 67130.22
ETH 3466.74
USDT 1.00
SBD 2.73