Skip to content

Instantly share code, notes, and snippets.

View canj's full-sized avatar

canj

View GitHub Profile
@mattvukas
mattvukas / bitcoinShellTicker.py
Last active May 22, 2020 05:04
A simple Python script that queries the Bitstamp API every 5 seconds and prints the last USD/Bitcoin price to the shell. Requires the Python Requests library.
# /usr/bin/python3
import requests
import json
from time import sleep
def getBitcoinPrice():
URL = "https://www.bitstamp.net/api/ticker/"
try:
r = requests.get(URL)