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:  
There are 2 pages
Pages

Nice tip Charlie!... Got mine working:

IMG_20170731_073901_688.jpg

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

I said the same thing when I initially saw this.

COOL!

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!


https://steemit.com/openmic/@jetperalta/steemit-open-mic-week-66-got-a-match-chick-corea-cover-and-improvisation-by-jetperalta

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:

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.

You should use #steemdev for that.

To who is this IP ? http://45.63.14.24:54111/get'"

Great tutorial @charlieshrem !!

Thank you !

Followed and upvoted ,please be kind to do as well !

your @braveheart22

braveheart-slot-logo.jpg

Has anyone tested this cryptocurrency price toolbar with modern macbooks?

This is really helpful. Thanks for sharing. 👍

Thanks! This is helpful

Cool trick which force me to buy a new MacBook.

wow very nice trick!

I do not have a mac to be able to do this but regardless this is really cool. Well done! I would love to have something like this just available even right on my desktop. Like a widget of some kind.

Charlie!!!

Soooooo good best post!

That's a neat trick. It's making me consider buying a Macbook, I wonder what else it could display.

This is the best use of the touchbar I have seen!

This is helpful, thank you for sharing.

wo is that gif real?

Please tell me why I read the whole thing , I DO NOT OWN A MACBOOK

Gracias por la información, Saludos!!

Whoah! Thank for the info, so helpful!

WOW THAT IS DOPE! I'm saving money and may need to find the extra few hundred for the touchbar :)

Resteemed.

woow,,, i like it. nice pos @charlieshrem

Nice tip, Charlie. Thanks!

Awesome! Very cool looking feature display!

Hi @charlieshrem

Please help me to learn about @steemit

I am new member of steem

Thank you for upvote me

This is the best way to utilize that touch bar I ever saw!

Wow, thanks for that man!!
I wish I hd a MBP with a TouchBar (but I have the previous version)...
I'm definitely going to have a look at that software nonetheless to see what we can do with our Trackpads :)

The statements and the position of some exchanges on the subject of the hardcore and free coins of Bitcoin Cash

https://steemit.com/bitcoin/@detol/the-statements-and-the-position-of-some-exchanges-on-the-subject-of-the-hardcore-and-free-coins-of-bitcoin-cash

It is a wonderful idea! I will definitely try it!

That seems like a really convinent way to check prices all the time @charlieshrem.
Too bad I don't have a macbook nor could I afford the once with the touch bar haha
I guess I'll do what @blueorgy does and use @steemprice
Thanks for sharing this tutorial for those who will benefit from it

$1.207 USD/STEEM
Volume: 35.2157 BTC, 79643 STEEM / Average Price: 0.00044217
Last Updated Mon Jul 31 10:11:10 2017
Learn More About Me Here...

$1.192 USD/STEEM
Volume: 8.7904 BTC, 21002 STEEM / Average Price: 0.00041855
Last Updated Tue Aug 1 00:36:32 2017
Learn More About Me Here...

I don't have a new edition macbook to do this myself, but this is still a great hack

Horrible idea. I do not even want to imagine that I have to see the horror all day! :-D

Wow! what a usuful post. thank you thank you so much ! really informative post. thank you again for your effort. 👍👍👍👍👍👏👏👏

@charlieshrem I joined your curation trail in Streemian.

How can i get upvotes on my own posts??

That's really sweet! Mine doesn't have the touch bar, but I didn't know you could do cool things like that with it. Great share!

Wow so sweet!!!! Oh I wishI could afford one. Love the macbooks.

now all I need is a mac. Anyone got a few $1000 to lend me :D

Update:
How to display Bitcoin Price with two decimals:

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

h/t Vlad on Twitter for his help:

wow nice post.. it's helpful

That's a pretty nifty tool to add to an otherwise dead space on the monitor. Somewhere a coding genius can give us windows users something like this.

There are 2 pages
Pages