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
#!/bin/bash | |
#MIT License | |
# | |
#Copyright (c) 2018 cryptorex @ github.com | |
# | |
#Permission is hereby granted, free of charge, to any person obtaining a copy | |
#of this software and associated documentation files (the "Software"), to deal | |
#in the Software without restriction, including without limitation the rights | |
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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
$(document).ready(function(){ | |
var ctable = $('#connections-table').dataTable( { | |
autoWidth: true, | |
searching: false, | |
ordering: false, | |
responsive: true, | |
lengthChange: true, | |
processing: true, | |
ajax: { | |
url: '/ext/connections', |
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
$.ajax({url: 'https://api.gemini.com/v1/pubticker/btcusd', | |
type: "GET", | |
dataType: "jsonp", | |
success: function(json) { | |
var obj = JSON.parse(json); | |
console.log(obj); | |
} |
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
$.ajax({url: 'https://api.gemini.com/v1/pubticker/btcusd', | |
type: "GET", | |
dataType: "jsonp", | |
success: function(json) { | |
var obj = JSON.parse(json); | |
console.log(obj); |
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
$(document).ready(function(){ | |
$('##{active}').addClass('active'); | |
function update_stats(){ | |
$.ajax({url: '/ext/summary', success: function(json){ | |
$("#supply").text(numeral(json.data[0].supply).format('0,0.000000')); | |
$("#difficulty").text(numeral(json.data[0].difficulty).format('0,0.00000000000')); | |
$("#difficultyHybrid").text(json.data[0].difficultyHybrid); | |
$("#hashrate").text(numeral(json.data[0].hashrate).format('0,0.0000')); | |
$("#lastPrice").text(json.data[0].lastPrice.toFixed(8)); | |
$("#lblConnections").text(json.data[0].connections + ' connections'); |
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
var request = require('request'); | |
var base_url = 'https://trade.cryptobroker.io/api/v2'; | |
var bresponse = undefined | |
function get_summary(coin, exchange, cb) { | |
var req_url = base_url + '/tickers/' + coin + exchange + '.json'; | |
request({uri: req_url, json: true}, function (error, response, body) { | |
bresponse = body; | |
cb() |