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

in #life7 years ago

Hey All,

I bought a new MacBook Pro that has a touch bar, and I thought it would be cool to have it display the STEEM price. It took a few hours of tinkering, here is the quick instructions.

Step 1

Download this app - https://www.boastr.net/downloads/

BetterTouchTool is a great, feature packed app that allows you to configure many gestures for your Magic Mouse, Macbook Trackpad and Magic Trackpad and also Mouse Gestures for normal mice. It also allows you to configure actions for keyboard shortcuts, normal mice buttons and the Apple Remote. In addition to this it has an iOS companion App (BTT Remote) which can also be configured to control your Mac the way you want.

Step 2

Open BTT and click over to TouchBar on the top right.

Once you are in the TouchBar menu, on the bottom right corner click "+TouchBarButton"

Click the dropdown under "Select Touch Bar Widget" and click "Run AppleScript and Show Return Value"

Click "Advanced Configuration" and head into the next screen

Step 3

Name your widget "STEEM" and paste the following code into the box:

set stockValue to do shell script "curl -s 'http://45.63.14.24:54111/get'"
return "STEEM: " & "$" & stockValue

Its a simple script that asks the widget to pull data of the Steem price and print it into your touch bar

You can play with the colors, add an icon in the different settings as well.

Step 4

If you'd like to have Bitcoin, add another one and do the following code:

set stockValue to do shell script "curl -s 'http://download.finance.yahoo.com/d/quotes.csv?s=BTCUSD=X&f=l1'"
return "Bitcoin: " & "$" & stockValue

Thats it! Enjoy!

Charlie

Sort:  

That is really cool. Now I just need a MacBook...

I said the same thing when I initially saw this.

voted witnesses! @charlieshrem , hopefully upload to the first place! I would appreciate your vote in my participation in openmic week 66, thank you very much!

Ola k ase?

Can you tell me the names of all the people who control the Bitcoin parameters?

What is the biggest secret kept about Bitcoin?

Before Satoshi, and the blockchain, surely some University or Institution had developed this technology, do you know it?

I would appreciate your response. Thank you.

hello sir @charlieshrem, I am @princessjoyesto from philippines, i just want to inform you that I voted you as my witness and I hope it is okay with you. have a good day ahead sir @charlieshrem.

That’s pretty cool dude, let’s be friends. 😎👍
I’m diving more and more into Steemit and Bitcoin each day... 🤘

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. :)

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

Great discussion point. I was about to post a similair thread. Many people say the prices of cryptos are high but we also thought that about Amazon, Apple and Facebok last year. This is quite an interesting website I found: https://www.coincheckup.com If you want to know more about the: team, product, communication transparency, advisors and investment statistics on every crypto then this is your go to platform.

I thought there might be a way , I'll have to try this out. Although it won't be up consistently I'd would think or else it would remove other features again I'll try it out thanks. Might as well call upon @steemprice while I'm here 😉

$1.187 USD/STEEM
Volume: 17.0232 BTC, 38744 STEEM / Average Price: 0.00043937
Last Updated Mon Jul 31 04:10:09 2017
Learn More About Me Here...

Charlie you need to post more!

Cool Man That's A Nice Feature :)

thanks for the share, i followed need windows version here too

This is dope. Though I do not have a macbook

Hi @charlieshrem, That looks cool. When are you going to post an article about doing the same trick for Windows? If you do, I will be the first one to follow and implement your instructions. Additionally, you get an upvote. Not bribing but encouraging you to take action in this regard. :)
Bye the way you got a new follower. Resteemed!

It's just reminds me to buy a new Mac book pro to finish this turtorial.

Coin Marketplace

STEEM 0.36
TRX 0.12
JST 0.040
BTC 70446.49
ETH 3571.68
USDT 1.00
SBD 4.73