[Docker] Hive Price Monitor

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@chitty·
0.000 HBD
[Docker] Hive Price Monitor
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](https://hub.docker.com/repository/docker/pixelnoob/monitor) 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
</br>
To view the monitor just type in your terminal:

    docker logs -f monitor
</br>
![Captura de pantalla 2020-04-28 a la(s) 14.36.01.png](https://images.hive.blog/DQmYCbb6xuRkQsLKL3fqkc3FGU5EjfoKXVRmANw1rqcZaPn/Captura%20de%20pantalla%202020-04-28%20a%20la(s)%2014.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
</br>
![Captura de pantalla 2020-04-28 a la(s) 14.31.11.png](https://images.hive.blog/DQmXGoTXwGyrNkEkxyqAGbNyTHTc8matzNQfj2gQc1C2DEU/Captura%20de%20pantalla%202020-04-28%20a%20la(s)%2014.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](https://hivesigner.com/sign/account-witness-vote?witness=chitty&approve=1)
**Hive.Blog:** [Vote for Chitty](https://wallet.hive.blog/~witnesses)*
**PeakD:** [Vote for Chitty](https://peakd.com/@chitty)
👍 , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,