@ 2014-04-19T04:05:15Z <?php
/*
Vircurex API Auto trader - functions.php
Written by: Frozennova
Version 1.1
Date: 23/12/2013
*/
date_default_timezone_set("UTC");
function balance($cur,$user_name,$secret_word) {
$t = date("Y-m-d\TH:i:s", time());
$year = date("Y", time());
$trx_id = hash("sha256", $t."-".rand()); //
$tok = hash("sha256", $secret_word.";".$user_name.";".$t.";".$trx_id.";get_balance;" . $cur);
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, "https://api.vircurex.com/api/get_balance.json?account=$user_name&id=$trx_id&token=$tok×tamp=$t¤cy=" .$cur);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$resp = curl_exec($ch);
$resp = json_decode($resp,true);
if (!isset($resp['availablebalance'])) {
$resp['availablebalance'] = "0.00";
}
return $resp['availablebalance'];
}
function get_sell_price($cur,$user_name,$secret_word) {
$t = date("Y-m-d\TH:i:s", time());
$year = date("Y", time());
$trx_id = hash("sha256", $t."-".rand()); //
$tok = hash("sha256", $secret_word.";".$user_name.";".$t.";".$trx_id.";get_balance;" . $cur);
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, "https://api.vircurex.com/api/get_highest_bid.json?base=" . $cur . "&alt=BTC");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$resp = curl_exec($ch);
$resp = json_decode($resp,true);
return $resp['value'];
}
function get_buy_price($cur,$user_name,$secret_word) {
$t = date("Y-m-d\TH:i:s", time());
$year = date("Y", time());
$trx_id = hash("sha256", $t."-".rand()); //
$tok = hash("sha256", $secret_word.";".$user_name.";".$t.";".$trx_id.";get_balance;" . $cur);
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, "https://api.vircurex.com/api/get_lowest_ask.json?base=" . $cur . "&alt=BTC");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$resp = curl_exec($ch);
$resp = json_decode($resp,true);
return $resp['value'];
}
function buy_coin($cur,$qty,$price,$user_name,$secret_word) {
$t = date("Y-m-d\TH:i:s", time());
$year = date("Y", time());
$trx_id = hash("sha256", $t."-".rand()); //
$tok = hash("sha256", $secret_word.";".$user_name.";".$t.";".$trx_id.";create_order;buy;$qty;$cur;$price;btc");
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, "https://api.vircurex.com/api/create_order.json?account=$user_name&id=$trx_id&token=$tok×tamp=$t&ordertype=buy&amount=$qty¤cy1=$cur&unitprice=$price¤cy2=btc");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$resp = curl_exec($ch);
return $resp;
}
function sell_coin($cur,$price,$qty,$user_name,$secret_word) {
$t = date("Y-m-d\TH:i:s", time());
$year = date("Y", time());
$trx_id = hash("sha256", $t."-".rand()); //
$tok = hash("sha256", $secret_word.";".$user_name.";".$t.";".$trx_id.";create_order;sell;$qty;$cur;$price;btc");
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, "https://api.vircurex.com/api/create_order.json?account=$user_name&id=$trx_id&token=$tok×tamp=$t&ordertype=sell&amount=$qty¤cy1=$cur&unitprice=$price¤cy2=btc");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$resp = curl_exec($ch);
return $resp;
}
function get_orders($user_name,$secret_word) {
$t = date("Y-m-d\TH:i:s", time());
$year = date("Y", time());
$trx_id = hash("sha256", $t."-".rand()); //
$tok = hash("sha256", $secret_word.";".$user_name.";".$t.";".$trx_id.";read_orders");
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, "https://api.vircurex.com/api/read_orders.json?account=$user_name&id=$trx_id&token=$tok×tamp=$t&otype=0");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$resp = curl_exec($ch);
$resp = json_decode($resp,true);
$i = 0;
if (isset($resp)) {
foreach($resp as $val) {
if (isset($val['orderid'])) {
$unreleased_orders[$i] = $val['orderid'];
$i++;
}
}
}
if(isset($unreleased_orders)){
return $unreleased_orders;
}
}
function release_order($orderid,$user_name,$secret_word) {
$t = date("Y-m-d\TH:i:s", time());
$year = date("Y", time());
$trx_id = hash("sha256", $t."-".rand()); //
$tok = hash("sha256", $secret_word.";".$user_name.";".$t.";".$trx_id.";release_order;$orderid");
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, "https://api.vircurex.com/api/release_order.json?account=$user_name&id=$trx_id&token=$tok×tamp=$t&orderid=$orderid");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$resp = curl_exec($ch);
$resp = json_decode($resp,true);
return $resp;
}
function read_order($orderid,$user_name,$secret_word) {
$t = date("Y-m-d\TH:i:s", time());
$year = date("Y", time());
$trx_id = hash("sha256", $t."-".rand()); //
$tok = hash("sha256", $secret_word.";".$user_name.";".$t.";".$trx_id.";read_order;$orderid");
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, "https://api.vircurex.com/api/read_order.json?account=$user_name&id=$trx_id&token=$tok×tamp=$t&otype=0&orderid=$orderid");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$resp = curl_exec($ch);
$resp = json_decode($resp,true);
return $resp['order'];
}
?>
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Version System time (s) User time (s) Memory (MiB) 7.1.7 0.004 0.004 16.87 7.1.6 0.019 0.006 19.82 7.1.5 0.010 0.013 16.83 7.1.0 0.007 0.073 22.45 7.0.20 0.000 0.008 16.75 7.0.14 0.003 0.073 22.09 7.0.8 0.047 0.077 20.19 7.0.7 0.070 0.053 20.05 7.0.6 0.060 0.070 19.95 7.0.5 0.057 0.080 20.40 7.0.4 0.003 0.053 20.20 7.0.3 0.007 0.070 20.08 7.0.2 0.007 0.050 20.05 7.0.1 0.003 0.087 20.07 7.0.0 0.003 0.073 19.95 5.6.28 0.000 0.077 21.14 5.6.23 0.007 0.073 20.67 5.6.22 0.013 0.063 20.69 5.6.21 0.003 0.047 20.49 5.6.20 0.007 0.053 21.18 5.6.19 0.003 0.090 21.07 5.6.18 0.007 0.047 21.09 5.6.17 0.003 0.060 21.02 5.6.16 0.010 0.033 21.00 5.6.15 0.010 0.080 21.13 5.6.14 0.007 0.060 21.08 5.6.13 0.013 0.077 21.07 5.6.12 0.010 0.087 21.00 5.6.11 0.010 0.050 20.99 5.6.10 0.007 0.083 21.12 5.6.9 0.003 0.087 21.09 5.6.8 0.007 0.080 20.56 5.6.7 0.000 0.083 20.55 5.6.6 0.013 0.043 20.38 5.6.5 0.013 0.057 20.58 5.6.4 0.003 0.047 20.38 5.6.3 0.003 0.040 20.36 5.6.2 0.000 0.043 20.50 5.6.1 0.003 0.040 20.52 5.6.0 0.013 0.057 20.36 5.5.37 0.007 0.040 20.41 5.5.36 0.007 0.050 20.39 5.5.35 0.007 0.047 20.38 5.5.34 0.013 0.073 20.95 5.5.33 0.017 0.080 20.89 5.5.32 0.010 0.077 20.96 5.5.31 0.010 0.080 20.89 5.5.30 0.007 0.073 20.94 5.5.29 0.003 0.043 20.86 5.5.28 0.010 0.047 20.93 5.5.27 0.013 0.043 20.67 5.5.26 0.000 0.087 20.86 5.5.25 0.003 0.087 20.65 5.5.24 0.020 0.070 20.37 5.5.23 0.013 0.067 20.25 5.5.22 0.013 0.063 20.26 5.5.21 0.007 0.037 20.31 5.5.20 0.010 0.040 20.30 5.5.19 0.003 0.047 20.29 5.5.18 0.007 0.043 20.31 5.5.16 0.010 0.033 20.34 5.5.15 0.000 0.040 20.30 5.5.14 0.003 0.037 20.18 5.5.13 0.003 0.037 20.34 5.5.12 0.003 0.043 20.18 5.5.11 0.003 0.037 20.33 5.5.10 0.007 0.043 20.14 5.5.9 0.013 0.037 20.23 5.5.8 0.010 0.040 20.15 5.5.7 0.017 0.060 20.16 5.5.6 0.000 0.040 20.12 5.5.5 0.000 0.043 20.16 5.5.4 0.003 0.033 20.12 5.5.3 0.013 0.027 20.16 5.5.2 0.003 0.040 20.14 5.5.1 0.003 0.047 20.09 5.5.0 0.010 0.030 20.12 5.4.45 0.003 0.060 19.42 5.4.44 0.000 0.043 19.18 5.4.43 0.000 0.050 19.20 5.4.42 0.007 0.090 19.45 5.4.41 0.010 0.033 19.10 5.4.40 0.017 0.040 19.19 5.4.39 0.007 0.043 19.09 5.4.38 0.007 0.043 18.84 5.4.37 0.017 0.030 19.03 5.4.36 0.013 0.060 19.07 5.4.35 0.003 0.040 19.12 5.4.34 0.003 0.040 18.91 5.4.32 0.007 0.037 18.90 5.4.31 0.007 0.033 19.12 5.4.30 0.003 0.037 19.03 5.4.29 0.000 0.040 19.02 5.4.28 0.003 0.047 19.02 5.4.27 0.003 0.043 19.13 5.4.26 0.003 0.060 19.09 5.4.25 0.010 0.030 19.12 5.4.24 0.007 0.077 19.22 5.4.23 0.000 0.040 19.12 5.4.22 0.007 0.037 19.11 5.4.21 0.007 0.053 19.04 5.4.20 0.007 0.040 18.94 5.4.19 0.013 0.027 19.04 5.4.18 0.003 0.043 18.89 5.4.17 0.003 0.053 18.89 5.4.16 0.003 0.053 19.02 5.4.15 0.000 0.040 18.98 5.4.14 0.007 0.037 16.50 5.4.13 0.003 0.037 16.34 5.4.12 0.010 0.060 16.43 5.4.11 0.000 0.040 16.48 5.4.10 0.013 0.063 16.45 5.4.9 0.003 0.047 16.45 5.4.8 0.003 0.063 16.53 5.4.7 0.000 0.037 16.43 5.4.6 0.003 0.060 16.49 5.4.5 0.010 0.030 16.51 5.4.4 0.003 0.037 16.45 5.4.3 0.000 0.033 16.49 5.4.2 0.000 0.053 16.49 5.4.1 0.003 0.040 16.29 5.4.0 0.000 0.040 15.95 5.3.29 0.010 0.033 14.78 5.3.28 0.007 0.033 14.64 5.3.27 0.000 0.040 14.80 5.3.26 0.000 0.063 14.66 5.3.25 0.000 0.040 14.79 5.3.24 0.003 0.037 14.62 5.3.23 0.003 0.037 14.68 5.3.22 0.003 0.043 14.61 5.3.21 0.000 0.040 14.75 5.3.20 0.000 0.037 14.59 5.3.19 0.010 0.030 14.59 5.3.18 0.003 0.033 14.71 5.3.17 0.003 0.057 14.64 5.3.16 0.000 0.040 14.72 5.3.15 0.000 0.040 14.63 5.3.14 0.000 0.043 14.71 5.3.13 0.000 0.040 14.73 5.3.12 0.010 0.030 14.57 5.3.11 0.003 0.040 14.63 5.3.10 0.007 0.033 14.14 5.3.9 0.000 0.037 14.14 5.3.8 0.000 0.040 14.16 5.3.7 0.007 0.033 14.21 5.3.6 0.000 0.047 14.08 5.3.5 0.000 0.040 14.05 5.3.4 0.000 0.040 14.10 5.3.3 0.003 0.073 14.12 5.3.2 0.007 0.077 13.71 5.3.1 0.013 0.067 13.89 5.3.0 0.010 0.063 13.84
preferences:dark mode live preview
34.43 ms | 400 KiB | 5 Q