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.
#!/usr/bin/perl";
use strict;
use CGI;
open BTC, "history_BTC.csv";
my %array;
#my @type = ("deposit", "withdraw", "in", "out", "fee");
if ($ENV{'REQUEST_METHOD'} eq "GET") {
print "Content-Type: text/html\n\n
#!/usr/bin/php
$file_handle = fopen($argv[1], "r");
$array= array();
$replace = array("$",".",",");
while(!feof($file_handle)) {
$line_of_text = fgetcsv($file_handle, 1024);
if($line_of_text[0]!="Index"){
$temparray=explode(' ',$line_of_text[1]);
$date=$temparray[0];
if(!in_array($date, $temparray)){
$array[$date]=array();
}
if($array[$date][$line_of_text[2]]!==null){
$temp=$array[$date][$line_of_text[2]];
$array[$date][$line_of_text[2]]=$temp+floatval(str_replace($replace,"",trim($line_of_text[4])));
}else{
$array[$date][$line_of_text[2]]=floatval(str_replace($replace,"",trim($line_of_text[4])));
}
}
}
fclose($file_handle);
foreach ($array as $key=>$value){
if($key==null){
break;
}
$total=0.00;
$total=+$value['despoit']-$value['withdraw']+$value['in']-$value['out'];
echo $key.' Total: '.$total."\n";
if($value['despoit']!==null){
echo $key.' Despoit '.$value['despoit']."\n";
}
if($value['withdraw']!==null){
echo $key.' Withdrew '.$value['withdraw']."\n";
}
}
?>
01/01/2012, +5000, 7,25€
01/01/2012, withdraw, 1000 BTC
01/01/2012, deposit, 10000 €
02/05/2012, -2000, 8,58€
....
/*
This code is available to you under CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/).
If you use this tool to analyze your mtgox trades or use this code to build your own project, consider
donating to 12weixK5ttMdjeoQgdGca9mKMKxkCxZkBG and consider adding your work to this thread:
https://bitcointalk.org/index.php?topic=94769
Thank you!
2weiX, Bitsky and jl2012
*/
if (isset($_FILES['csv'])) {
if ($_FILES['csv']['size']>1024000) { die('file too big'); }
if ($_FILES['csv']['error']!==0) { die('upload error'); }
if ($_FILES['csv']['name']=='history_EUR.csv') { $currency='€'; }
elseif ($_FILES['csv']['name']=='history_USD.csv') { $currency='$'; }
else { $currency=''; }
$csv=file($_FILES['csv']['tmp_name'], FILE_IGNORE_NEW_LINES);
$out=parsecsv($csv);
$tmp=makecsv($out, $currency);
header('Content-type: text/plain');
header('Content-disposition: attachment; filename="converted_'.$_FILES['csv']['name'].'"');
echo $tmp;
}
else {
echo "\n";
echo "\n";
echo ";
echo "\n";
echo "\n";
echo "\n";
echo "\n";
echo "\n";
echo "\n";
}
exit;
function parsecsv($csv) {
global $currency;
$regex=array();
$regex['$']='/\] ([\d\.]+).+BTC at \$([\d\.]+)/';
$regex['€']='/\] ([\d\.]+).+BTC at ([\d\.]+)/';
$out=array();
foreach ($csv as $tmp) {
$line=explode(',', $tmp);
if (!is_numeric($line[0])) { continue; }
$line[1]=preg_replace('/"(.+) .*/', '$1', $line[1]);
if (!isset($out[$line[1]])) {
$out[$line[1]]=array();
$out[$line[1]]['day']=$line[1];
$out[$line[1]]['deposit']=0;
$out[$line[1]]['withdraw']=0;
$out[$line[1]]['earned']=0;
$out[$line[1]]['earnedbtc']=0;
$out[$line[1]]['earnedcur']=0;
$out[$line[1]]['earnedrate']=0;
$out[$line[1]]['fee']=0;
$out[$line[1]]['spent']=0;
$out[$line[1]]['spentbtc']=0;
$out[$line[1]]['spentcur']=0;
$out[$line[1]]['spentrate']=0;
}
if ($line[2]=='deposit') { $out[$line[1]]['deposit']+=$line[4]; }
elseif ($line[2]=='withdraw') { $out[$line[1]]['withdraw']+=$line[4]; }
elseif ($line[2]=='fee') { $out[$line[1]]['fee']+=$line[4]; }
elseif ($line[2]=='earned') {
$out[$line[1]]['earned']+=$line[4];
if (preg_match($regex[$currency], $line[3], $tmp)) {
$out[$line[1]]['earnedbtc']+=$tmp[1];
$out[$line[1]]['earnedcur']+=$line[4];
}
}
elseif ($line[2]=='spent') {
$out[$line[1]]['spent']+=$line[4];
if (preg_match($regex[$currency], $line[3], $tmp)) {
$out[$line[1]]['spentbtc']+=$tmp[1];
$out[$line[1]]['spentcur']+=$line[4];
}
}
}
return($out);
}
function makecsv($out, $currency) {
$tmp='';
global $currency;
foreach ($out as $i) {
if ($i['spentcur']>0) { $i['spentrate']=$i['spentcur']/$i['spentbtc']; }
if ($i['earnedbtc']>0) { $i['earnedrate']=$i['earnedcur']/$i['earnedbtc']; }
$i['day']=preg_replace('/(\d\d\d\d)\-(\d\d)\-(\d\d)/', '$3.$2.$1', $i['day']);
$tmp.=$i['day'].";DEPOSIT;".number_format($i['deposit'], 2, ',', '').$currency."\n";
$tmp.=$i['day'].";BUY;".number_format($i['spentbtc'], 8, ',', '')."BTC;".number_format($i['spentrate'], 8, ',', '').$currency."/BTC\n";
$tmp.=$i['day'].";SELL;".number_format($i['earnedbtc'], 8, ',', '')."BTC;".number_format($i['earnedrate'], 8, ',', '').$currency."/BTC\n";
$tmp.=$i['day'].";FEES;".number_format($i['fee'], 2, ',', '').$currency."\n";
$tmp.=$i['day'].";WITHDRAW;-".number_format($i['withdraw'], 2, ',', '').$currency."\n";
$tmp.="\n\n";
}
$tmp.="This code is available to you under CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/).\n\n";
$tmp.="If you use this tool to analyze your mtgox trades or use this code to build your own project, consider\n";
$tmp.="donating to 12weixK5ttMdjeoQgdGca9mKMKxkCxZkBG and consider adding your work to this thread:\n";
$tmp.="https://bitcointalk.org/index.php?topic=94769\n\n";
$tmp.="Thank you!\n";
$tmp.="2weiX, Bitsky and jl2012\n";
return($tmp);
}
?>
#!/usr/bin/perl
use strict;
open USD, "history_EUR.csv";
open OUTCSV, ">goxeur.csv";
open OUTCSVE, ">goxeur_e.csv";
my %array;
#my @type = ("deposit", "withdraw", "earned", "spent", "fee");
while () {
my ($date, $type, $info, $value, $balance) = ($_ =~ /^\d+,\"(\d{4}-\d{2}-\d{2}) .+?\",(.+?),(.+?),(.+?),(.+)/);
$date || next;
if (my ($x, $y) = $value =~ /(.*)E(.*)/) {
$value = $x * (10 ** $y);
}
$array{$date}{$type} += $value;
$array{$date}{balance} = $balance;
if ($type eq "spent") {
my ($btc, $price) = ($info =~ /(\d+\.\d+).*?BTC at \$?(\d+\.\d+)/);
$array{$date}{totalspent} += $value;
$array{$date}{totalboughtbtc} += $btc;
}
elsif ($type eq "earned") {
my ($btc, $price) = ($info =~ /(\d+\.\d+).*?BTC at \$?(\d+\.\d+)/);
$array{$date}{totalreceive} += $value;
$array{$date}{totalsoldbtc} += $btc;
}
}
foreach (sort keys %array) {
if ($array{$_}{deposit} > 0) {
print OUTCSV "\"$_\",\"DEPOSIT\",\"". sprintf("%.8f", $array{$_}{deposit}) . " EUR\"\n";
}
if ($array{$_}{withdraw} > 0) {
print OUTCSV "\"$_\",\"WITHDRAW\",\"". sprintf("%.8f", $array{$_}{withdraw}) . " EUR\"\n";
}
if ($array{$_}{fee} > 0) {
print OUTCSV "\"$_\",\"FEES\",\"". sprintf("%.8f", $array{$_}{fee}) . " EUR\"\n";
}
if ($array{$_}{totalboughtbtc} > 0) {
print OUTCSV "\"$_\",\"BUY\",\"". sprintf("%.8f", $array{$_}{totalboughtbtc}) . " BTC\",\"". $array{$_}{totalspent}/$array{$_}{totalboughtbtc} ." EUR\"\n";
}
if ($array{$_}{totalsoldbtc} > 0) {
print OUTCSV "\"$_\",\"SELL\",\"". sprintf("%.8f", $array{$_}{totalsoldbtc}) . " BTC\",\"". $array{$_}{totalreceive}/$array{$_}{totalsoldbtc} ." EUR\"\n";
}
}
close OUTCSV;
open OUTCSV, "goxeur.csv";
while () {
s/\./,/g;
print OUTCSVE;
}
#!/usr/bin/perl
use strict;
open USD, "history_USD.csv";
open OUTCSV, ">goxusd.csv";
open OUTCSVE, ">goxusd_e.csv";
my %array;
#my @type = ("deposit", "withdraw", "earned", "spent", "fee");
while () {
my ($date, $type, $info, $value, $balance) = ($_ =~ /^\d+,\"(\d{4}-\d{2}-\d{2}) .+?\",(.+?),(.+?),(.+?),(.+)/);
$date || next;
if (my ($x, $y) = $value =~ /(.*)E(.*)/) {
$value = $x * (10 ** $y);
}
$array{$date}{$type} += $value;
$array{$date}{balance} = $balance;
if ($type eq "spent") {
my ($btc, $price) = ($info =~ /(\d+\.\d+).*?BTC at \$?(\d+\.\d+)/);
$array{$date}{totalspent} += $value;
$array{$date}{totalboughtbtc} += $btc;
}
elsif ($type eq "earned") {
my ($btc, $price) = ($info =~ /(\d+\.\d+).*?BTC at \$?(\d+\.\d+)/);
$array{$date}{totalreceive} += $value;
$array{$date}{totalsoldbtc} += $btc;
}
}
foreach (sort keys %array) {
if ($array{$_}{deposit} > 0) {
print OUTCSV "\"$_\",\"DEPOSIT\",\"". sprintf("%.8f", $array{$_}{deposit}) . " USD\"\n";
}
if ($array{$_}{withdraw} > 0) {
print OUTCSV "\"$_\",\"WITHDRAW\",\"". sprintf("%.8f", $array{$_}{withdraw}) . " USD\"\n";
}
if ($array{$_}{fee} > 0) {
print OUTCSV "\"$_\",\"FEES\",\"". sprintf("%.8f", $array{$_}{fee}) . " USD\"\n";
}
if ($array{$_}{totalboughtbtc} > 0) {
print OUTCSV "\"$_\",\"BUY\",\"". sprintf("%.8f", $array{$_}{totalboughtbtc}) . " BTC\",\"". $array{$_}{totalspent}/$array{$_}{totalboughtbtc} ." USD\"\n";
}
if ($array{$_}{totalsoldbtc} > 0) {
print OUTCSV "\"$_\",\"SELL\",\"". sprintf("%.8f", $array{$_}{totalsoldbtc}) . " BTC\",\"". $array{$_}{totalreceive}/$array{$_}{totalsoldbtc} ." USD\"\n";
}
}
close OUTCSV;
open OUTCSV, "goxusd.csv";
while () {
s/\./,/g;
print OUTCSVE;
}