[Docker] Hive Price Monitor

in HiveDevs4 years ago (edited)

Hello Hivers,

Today I created an easy to deploy Price Monitor that tracks the price of Hive and other major cryptocurrencies like Bitcoin, Ethereum and EOS.

If you use Docker you can quickly set up your monitor in minutes with the following commands:

docker pull pixelnoob/monitor:latest
docker run -d --name monitor pixelnoob/monitor:latest


To view the monitor just type in your terminal:

docker logs -f monitor


Captura de pantalla 2020-04-28 a la(s) 14.36.01.png

If you only wish to see the latest prices for HIVE you can specify it with a grep command:

docker logs -f monitor | grep HIVE


Captura de pantalla 2020-04-28 a la(s) 14.31.11.png

You can easily start and stop the docker with docker start monitor or docker stop monitor.

Whats inside the Docker

The Docker contains a very simple python script that loops the CryptoCompare API to track coin's prices. If you don't use docker, you could just run this python script to start the monitor.

import requests as r
import json
import time

while True:
    data = r.get('https://min-api.cryptocompare.com/data/pricemulti?fsyms=BTC,ALGO,BNB,XLM,TLOS,ETH,EOS,HIVE,STEEM&tsyms=USD').json()
    print('BTC', data["BTC"]['USD'])
    print('BNB', data["BNB"]['USD'])
    print('ETH', data["ETH"]['USD'])
    print('EOS', data["EOS"]['USD'])
    print('ALGO', data["ALGO"]['USD'])
    print('HIVE', data["HIVE"]['USD'])
    print('Steem', data["STEEM"]['USD'])
    print('XLM', data["XLM"]['USD'])
    print('TELOS', data["TLOS"]['USD'])
    print('...........3s..........')
    time.sleep(3)

I hope you find this monitor useful, for me its easier than checking coinmarketcap.com all the time or going to an exchange that consumes a lot of RAM and CPU.

All feedback is welcome!

Note: All prices are in USD.


Please consider voting for my witness:
Hivesinger: Vote for Chitty
Hive.Blog: Vote for Chitty

PeakD: Vote for Chitty

Sort:  

This will really help to.get notified about how the price is behaving

Thanks for sharing your creative and inspirational post on HIVE!



This post got curated by our fellow curator @tibfox and you received a 100% upvote from our non-profit curation service!

Join the official DIYHub community on HIVE and show us more of your amazing work!