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

You are viewing a single comment's thread from:

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

in life •  7 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. :)

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

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

  ·  7 years ago (edited)