lib/utils.rb in SimBot-0.1.40 vs lib/utils.rb in SimBot-0.1.41
- old
+ new
@@ -40,12 +40,12 @@
end
# fetch btc/usd price from coin market cap
# @return [float] rate
def self.tusdzar_price
- response = RestClient.get('https://free.currencyconverterapi.com/api/v6/convert?q=USD_ZAR')
+ response = Faraday.get('https://www.freeforexapi.com/api/live?pairs=USDZAR')
hash = JSON.parse(response.body)
- hash['results']['USD_ZAR']['val'].to_f.round(4)
+ hash['rates']['USDZAR']['rate'].to_f.round(2)
end
# fetch btc/usd price from coin market cap
# @return [float] rate