In order to setup the bitcoin trade advice alert, go through the following steps:
- First, start by importing the bitcoin price API, called exchanges:
#!/usr/bin/python
# import modules
# Make sure to copy the exchanges from https://github.com/dursk/bitcoin-price-api
# to the same location as this script
from exchanges.bitfinex import Bitfinex
- Also import smtplib, which we will use for triggering the bitcoin price alert. Here, we define a function called trigger_email. We then set the server user and email details:
import smtplib
# Function to send email
def trigger_email(msg):
# Change these to your email details
email_user = "bitcoin.harish@gmail.com"
email_password = "bitcoin1"
smtp_server = 'smtp.gmail.com'
smtp_port = 587
email_from = "bitcoin.harish@gmail.com"
email_to = "bitcoin.harish@gmail...