Skip to content

Instantly share code, notes, and snippets.

View cryptorex's full-sized avatar

cryptorex

  • US
View GitHub Profile
#!/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
$(document).ready(function(){
var ctable = $('#connections-table').dataTable( {
autoWidth: true,
searching: false,
ordering: false,
responsive: true,
lengthChange: true,
processing: true,
ajax: {
url: '/ext/connections',
$.ajax({url: 'https://api.gemini.com/v1/pubticker/btcusd',
type: "GET",
dataType: "jsonp",
success: function(json) {
var obj = JSON.parse(json);
console.log(obj);
}
$.ajax({url: 'https://api.gemini.com/v1/pubticker/btcusd',
type: "GET",
dataType: "jsonp",
success: function(json) {
var obj = JSON.parse(json);
console.log(obj);
$(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');
@cryptorex
cryptorex / cb.old.js
Created September 27, 2017 19:54
callback json api
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()