Added
- Total balance viewer converted into USD (based on Tradehill)
Fixed
- Some IE bugs
I hope you guys like it.
It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
$ node walletmon.js
var http = require('http');
var currency = 'USD';
var addresses = [
'17xxoEVft19Rg2V4vqop92Az7Hp7vbtttV',
'13kEG7RopYCSqgG1T1YsULpTQx5sW1PLTy',
'1MWYjCaMunK2rERswXxiNTV641y23k38BS',
'1GaLzoNQbuJB4hDgY4YBgvjxzPqHkCebgj',
];
function getReceived(address, callback) {
getData(address, 'received', callback);
}
function getSent(address, callback) {
getData(address, 'sent', callback);
}
function getData(address, method, callback) {
var options = {
host: 'blockexplorer.com',
port: 80,
path: '/q/get'+method+'byaddress/'+address,
};
http.get(options, function(res) {
var answer = '';
res.on('data', function (chunk) {
answer += chunk;
});
res.on('end', function (chunk) {
if(chunk) answer += chunk;
callback(answer);
});
});
}
function getWeightedPrices(callback) {
var options = {
host: 'bitcoincharts.com',
port: 80,
path: '/t/weighted_prices.json',
};
http.get(options, function(res) {
var answer = '';
res.on('data', function (chunk) {
answer += chunk;
});
res.on('end', function (chunk) {
if(chunk) answer += chunk;
callback(JSON.parse(answer));
});
});
}
function fetch(index, callback) {
getReceived(addresses[index], function(received) {
var bal = Math.round(received * 1e8);
getSent(addresses[index], function(sent) {
bal -= Math.round(sent * 1e8);
console.log(addresses[index]+' received: '+received+', sent: '+sent+', bal: '+(bal/1e8));
callback(bal);
});
});
}
function main() {
var total=0;
var count=addresses.length;
for(i=0; i(function(index) {
fetch(index, function(bal) {
total += bal;
count--;
if(count == 0) {
getWeightedPrices(function(prices) {
var p24h = Math.round(total * prices[currency]['24h'] / 1e6) / 1e2;
var p7d = Math.round(total * prices[currency]['7d'] / 1e6) / 1e2;
var p30d = Math.round(total * prices[currency]['30d'] / 1e6) /1e2;
console.log('');
console.log('Total: '+ (total / 1e8) + ' BTC ('+addresses.length+' addresses)');
console.log('USD: '+p24h+'(24h), '+p7d+'(7d) '+p30d+'(30d)');
})
}
});
})(i);
}
}
main();