Vircurex API


SUBMITTED BY: Guest

DATE: Nov. 13, 2012, 6:09 a.m.

FORMAT: Perl

SIZE: 1.1 kB

HITS: 1361

  1. $amt=shift(@ARGV);$price=shift(@ARGV);
  2. use Digest::SHA;use Time::HiRes qw(time);use POSIX qw(strftime);
  3. $id=int(time()*1000000);$tstamp=strftime("%Y-%m-%dT%H:%M:%S",gmtime());
  4. $token="$secret;$username;$tstamp;$id;create_order;SELL;$amt;$c;$price;$cc";
  5. $sig=Digest::SHA::sha256_hex($token);
  6. $data=readpipe("curl -L -m 30 -s -k \"https://vircurex.com/api/create_order.json?ordertype=SELL&amount=$amt&currency1=$c&unitprice=$price&currency2=$cc&account=$username&id=$id&token=$sig&timestamp=$tstamp\"");
  7. $_=$data;s/[" ]//ig;if(/orderid:([0-9\.]*),/ig){$oid=$1;sleep(0.2);
  8. $id=int(time()*1000000);$tstamp=strftime("%Y-%m-%dT%H:%M:%S",gmtime());
  9. $token="$secret;$username;$tstamp;$id;release_order;$oid";
  10. $sig=Digest::SHA::sha256_hex($token);
  11. $data=readpipe("curl -L -m 30 -s -k \"https://vircurex.com/api/release_order.json?orderid=$oid&account=$username&id=$id&token=$sig&timestamp=$tstamp\"");
  12. $out=$amt*$price;print "Selling $amt $c for $cc on Vircurex at $price (total $out $cc)\n";

comments powered by Disqus