This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Dashing.Ethprice extends Dashing.Widget | |
@accessor 'value', Dashing.AnimatedValue | |
@accessor 'ethprice', -> | |
if @get('value') | |
price = parseFloat(@get('value')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Dashing.Btcprice extends Dashing.Widget | |
@accessor 'value', Dashing.AnimatedValue | |
@accessor 'btcprice', -> | |
if @get('value') | |
price = parseFloat(@get('value')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/http' | |
require 'json' | |
require 'uri' | |
SCHEDULER.every '5s', allow_overlapping: false do | |
uri = URI.parse('https://api.coinbase.com/v2/prices/LTC-EUR/spot') | |
http = Net::HTTP.new(uri.host, uri.port) | |
http.use_ssl = true | |
request = Net::HTTP::Get.new(uri.request_uri) |