Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add any coin with the following. #9

Open
sirged opened this issue Dec 20, 2017 · 5 comments
Open

Add any coin with the following. #9

sirged opened this issue Dec 20, 2017 · 5 comments

Comments

@sirged
Copy link

sirged commented Dec 20, 2017

set coin to do shell script "curl -s 'https://min-api.cryptocompare.com/data/price?fsym=(TickerChar)&tsyms=USD' | sed 's/[^0-9\\.]*//g'"
return "$" & coin

This is a little cleaner and quicker to return. As well it aggregates data. Good for coins with low volume, or that are not on bittrex. Also would allow quick exchange to localized currency as well (GBP, EUR, etc...)

Examples
HUSH
ENJ

set coin to do shell script "curl -s 'https://min-api.cryptocompare.com/data/price?fsym=HUSH&tsyms=USD' | sed 's/[^0-9\\.]*//g'"
return "$" & coin

set coin to do shell script "curl -s 'https://min-api.cryptocompare.com/data/price?fsym=ENJ&tsyms=USD' | sed 's/[^0-9\\.]*//g'"
return "$" & coin

@ghost
Copy link

ghost commented Dec 26, 2017

screen shot 2017-12-26 at 10 02 10

@trjones8918
Copy link

Can anyone post code to view TRX and ADA?

@syncera
Copy link

syncera commented Apr 10, 2018

this isn't going to give you a snazzy icon, but it does the work.

the icons are being drawn by their code in these examples, which I do not have handy

we re-use the icons provided by the other examples given to us these working tabs

Ultimately, all we're really doing is changing the ticker address. Hope this helps.

This first one is for TRX Tron, others are commented out

set json to do shell script "curl -H 'CB-VERSION: 2015-04-08' https://api.coinbase.com/v2/prices/ETH-USD/spot"
set json to do shell script "sed s/warnings.*//g <<< " & json
set eth to do shell script "sed s/[a-zA-Z:{},]//g <<< " & json
set eth to eth as real

set pay to do shell script "curl -s 'https://bittrex.com/api/v1.1/public/getticker?market=eth-trx' | grep -oE '(Last).' | sed 's/[^0-9\\.]//g'"
set pay to pay as real

set answer to pay * eth
set answer to answer * 100
set answer to round answer
set answer to answer / 100
return "$" & answer

verge XVG below

set json to do shell script "curl -H 'CB-VERSION: 2015-04-08' https://api.coinbase.com/v2/prices/BTC-USD/spot"
set json to do shell script "sed s/warnings.*//g <<< " & json
set eth to do shell script "sed s/[a-zA-Z:{},]//g <<< " & json
set eth to eth as real

set pay to do shell script "curl -s 'https://bittrex.com/api/v1.1/public/getticker?market=btc-xvg' | grep -oE '(Last).' | sed 's/[^0-9\\.]//g'"
set pay to pay as real

set answer to pay * eth
set answer to answer * 100
set answer to round answer
set answer to answer / 100
return "$" & answer

cardano / ada below

set json to do shell script "curl -H 'CB-VERSION: 2015-04-08' https://api.coinbase.com/v2/prices/BTC-USD/spot"
set json to do shell script "sed s/warnings.*//g <<< " & json
set eth to do shell script "sed s/[a-zA-Z:{},]//g <<< " & json
set eth to eth as real

set pay to do shell script "curl -s 'https://bittrex.com/api/v1.1/public/getticker?market=btc-ada' | grep -oE '(Last).' | sed 's/[^0-9\\.]//g'"
set pay to pay as real

set answer to pay * eth
set answer to answer * 100
set answer to round answer
set answer to answer / 100
return "$" & answer

@trjones8918
Copy link

Thanks!!!

@glock47
Copy link

glock47 commented Oct 28, 2021

Repository owner deleted a comment from feras-ragheb Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants