You are viewing a single comment's thread from:

RE: Tutorial: How to Display the STEEM & Bitcoin price in your MacBook Touch Bar

in #life7 years ago (edited)

That's awsome. Thank's for sharing. As already mentioned it's horrible to see that all day, so I put mine a group. :)

In addition to Charlys great work I wondered how to add cryptos like dash or pivx and created the following script:

on replace_chars(this_text, search_string, replacement_string)
if this_text contains the search_string then
set AppleScript's text item delimiters to the search_string
set the item_list to every text item of this_text
set AppleScript's text item delimiters to the replacement_string
set this_text to the item_list as string
set AppleScript's text item delimiters to ""
end if
return this_text
end replace_chars
set stockValue to do shell script "curl -s 'https://api.coinmarketcap.com/v1/ticker/dash/' | grep 'price_usd'"
set stockValue to replace_chars(stockValue, " "price_usd": "", "")
set stockValue to replace_chars(stockValue, "", ", "")
return "" & "$" & stockValue

Hope it help's. :)

Sort:  

Awesome! Had to do some tweaking on the code though, since Steem seems not to work well for code syntax. Here's a raw txt version of the script for BTC ticker: https://gist.github.com/rendezfoo/a47870ad04e0c43cd80e3567666ae8c6

Coin Marketplace

STEEM 0.22
TRX 0.27
JST 0.041
BTC 104893.66
ETH 3859.77
SBD 3.29