Decred BTC price on Poloniex

Shows the last Decred price (in BTC) on the Poloniex exchange

Image preview of Decred BTC price on Poloniex plugin.

decred-btc-poloniex.30s.sh

Edit
Open on GitHub
#!/bin/bash

# <xbar.title>Decred BTC price on Poloniex</xbar.title>
# <xbar.version>v1.0</xbar.version>
# <xbar.author>James Hooker</xbar.author>
# <xbar.author.github>g0blinResearch</xbar.author.github>
# <xbar.desc>Shows the last Decred price (in BTC) on the Poloniex exchange</xbar.desc>
# <xbar.image>https://raw.githubusercontent.com/g0blinResearch/bitbar-decred-btc-poloniex/master/screenshot.png</xbar.image>
#
# Credit goes to https://www.monero.how for the base of this plugin (see https://raw.githubusercontent.com/matryer/bitbar-plugins/master/Monero/monero-btc-poloniex.30s.sh)

decredIconBase64='iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAABmJLR0QA/wD/AP+gvaeTAAAFvUlEQVRYw+2Xf3BU1RXHP+e+t9lAUmFQWixTrTACRkIIAskGlKAYfiSB6dTaglDUdhSmLZNMx5YWgxYbBuUP0OlMpsqAlrZQpbUQIhDB0EiyCcEACT9SOm2pCIitTCok2d337rv+sVmzGxO7mbH+lTPzZt6ePXvf537POfedhUEbtEH7gi3nR51Jx36vue5zf7705cz9YcfQkOuE2lMNuWmgO4TXNg/3APLXhTm81v9J7KPvvJ3S5aV4N10f5jlyFhO+jVbTQP28Fd7nBjStJJRrC/vEolPZIAqUjU9sKTm81v/72c+EqSmLQj12ovF2F12lxUtzcY0rWhw8XNHioi+5eH/Rxj1waNI3qgFmtO2mbsKi5IGml4Q4ujmVQGkkR9nefrEYLgqUBcoGlKypKfOvB3g0eJytgWweORb8mufTQRc92hUXBw+NxhWNi4cjGhf9tmuZxee6Wi7+Z8q6foFUb8fRzanklkQIbkppNMJ9wLl4dMGU37c+9NKidcbeGshmyYHTbJsauIBItsG8GVvHxF0Sve4Wz2sb67/j2xgIXHg1+ZQl1FNJ5AZfmtmnlMmLpU8ssGyOZp09m7txW7Z54I/vsuub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z/QVuaB81Wvn0DqW4O06h2Ns+em9x0ef3ArsfH3qheNt/qXxkGAALWqt+rvHKHdFodGwMafdEzzuWsbRx8pntnMhYljzQjJ8Y6p6LhuSXhQqUj7kIs5TFV8XCdMMYZSGi6LBsU7hnxZC/dcPwRmYhc09VLnHRm120Ewc2VGPmn8xY1jDgAa0/e7i0XV3NMXRehs7LYE20VXq7rfatGhKJxcw7tZf9E6Pz0aKrNaoldILxMorzzkh8H76f2pq9tJP/ty34VVfSsZNO/nbwf+egDdoXbh8D8XNf059XWtcAAAAASUVORK5CYII='

xmrLast=$(curl -s https://poloniex.com/public?command=returnTicker | tr '}' '\n' | grep BTC_DCR | tr -d '{}"' | tr ':,' '\n' | grep -A1 "last" | tail -1)
printf "%.*f | image=%s\n" 5 "$xmrLast" "$decredIconBase64"
echo "---"
echo "Decred homepage | href=\"https://www.decred.org\""