Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Bitcoin Programming with Python

You're reading from  Hands-On Bitcoin Programming with Python

Product type Book
Published in Aug 2018
Publisher
ISBN-13 9781789537000
Pages 90 pages
Edition 1st Edition
Languages
Author (1):
BignumWorks Software LLP BignumWorks Software LLP
Profile icon BignumWorks Software LLP
Toc

Triggering the bitcoin trade advice alert

In order to setup the bitcoin trade advice alert, go through the following steps:

  1. 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
  1. 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...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime