Advertisement
Guest User

SiaMining 1H Reward Script - by Danger

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