Author

Topic: Linux command line tool for Bitcoin / crypto quotes (bash) (Read 216 times)

sr. member
Activity: 443
Merit: 350
Thank you! Nice work!  Smiley
newbie
Activity: 29
Merit: 50
Hi all,

I wrote a small linux command line tool as a bash scripting learning project; it uses the CoinGecko-API and is capable of displaying all their supported crypto-currencies, as well as cross-currencies (>50 at the moment, including some cryptos and commodities gold and silver).

Enjoy!


Hey mate, nice script! I was very interested when i saw the topic here..
That is a very nice script of yours indeed. I love the colours!

I wrote some scripts for similar purposes and you may be interested.
https://github.com/mountaineerbr/markets
Specially, i wrote the cgk.sh which uses CoinGecko API, too.
Syntax is something like:

Code:
$ cgk.sh 5+5 BTC CNY
804340.0000000000000000

It has many options and i hope it is robust, however if the user is not
connected to the internet or the error is from CoinGecko side, i dont care
to troubleshoot for the user too much..
newbie
Activity: 3
Merit: 6
I updated the script - now it checks if the CoinGecko API is available, before doing anything else; if not, there is a message and the script terminates (no ugly parse error message anymore).

I figured out that with the "xmessage"-function the prices could be displayed in a pop-up-window; but all the colours would be gone, and the idea behind the script is that the desired information is accessible from and displaying to the command line interface  Roll Eyes.
newbie
Activity: 41
Merit: 0
Nice work, it would be cool if you show the output on widget which shows terminal output.

But looks like there's no handling in case CoinGecko forbid the request (usually due to VPN/Tor usage) or currently down. Simple error message should do the job, since currently it shows this error message

Code:
parse error: Invalid numeric literal at line 1, column 10

Check I have updated the topic for it.
newbie
Activity: 41
Merit: 0
It's easy, just what you need to do is for bitcoin or other currency which is fork of bitcoin or based on bitcoin.

Just download easybitcoin.php script.  Change the port and run the commands.
newbie
Activity: 3
Merit: 6
Thanks for the reply, I'm glad you liked it. I'll give the widget idea a shot. And you are right, no error handling yet. There is a "ping" function in the API where the script could test if it's available or not.
newbie
Activity: 3
Merit: 6
Hi all,

I wrote a small linux command line tool as a bash scripting learning project; it uses the CoinGecko-API and is capable of displaying all their supported crypto-currencies, as well as cross-currencies (>50 at the moment, including some cryptos and commodities gold and silver).

It can be found here:

https://github.com/fatrattombala/bash-btc-quote

An older, simpler and therefore faster version (also accessible on github) uses the Kraken-API and shows only BTC and ETH.

https://raw.githubusercontent.com/fatrattombala/bash-btc-quote/master/BTCquote.png

Enjoy!
Jump to: