Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tell application "JSON Helper"
- set siaMiningData to fetch JSON from "https://siamining.com/api/v1/addresses/af951a544c9178b635a5249ec39df52c416be2c5e41b59ebe04f390ae02aca87eb82a61a94b6/summary" with cleaning feed
- set rewardsHour to round (rewards of item 3 of intervals of siaMiningData)
- set binanceScBtcData to fetch JSON from "https://www.binance.com/api/v3/ticker/price?symbol=SCBTC" with cleaning feed
- set binanceScBtcPrice to price of binanceScBtcData as real
- set binanceBtcUsdtData to fetch JSON from "https://www.binance.com/api/v3/ticker/price?symbol=BTCUSDT" with cleaning feed
- set binanceBtcUsdtPrice to price of binanceBtcUsdtData as real
- set dollarPriceOfSc to binanceScBtcPrice * binanceBtcUsdtPrice
- set valueHour to (round (rewardsHour * dollarPriceOfSc * 100)) / 100
- set rewardsHourDelimited to do shell script "echo " & rewardsHour & " | perl -lpe'1 while s/^([-+]?\\d+)(\\d{3})/$1,$2/'"
- return ("1 Hour: " & rewardsHourDelimited & " SC ($" & valueHour & ")")
- end tell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement