chiark / gitweb /
More oceans
[ypp-sc-tools.db-live.git] / yarrg / commod-results-processor
index 7cd4e04..bb0724d 100755 (executable)
@@ -135,10 +135,12 @@ sub main__arbitrage () {
            sub arb_subtract_qty (\@) {
                my ($verbs) = @_;
                my $verb= shift @$verbs;
+               my $vqty= $verb->{Qty};
+               $vqty =~ s/^\>//;
                unshift @$verbs, {
                     Stall => $verb->{Stall},
                     Price => $verb->{Price},
-                    Qty => $verb->{Qty} - $qty
+                    Qty => $vqty - $qty
                };
            }
            arb_subtract_qty(@buys);
@@ -429,15 +431,14 @@ sub gzip ($) {
     return pipethrough_run($tf,undef,'gzip','gzip');
 }
 
-sub main__uploadyaarg () {
+sub main__uploadyarrg () {
     my %o;
 
     parse_info_clientside();
 
     $o{'ocean'}= $ENV{'YPPSC_OCEAN'} or die;
     $o{'island'}= $ENV{'YPPSC_ISLAND'} or die;
-    $o{'timestamp'}= 10;
-    get_our_version(\%o, 'client');
+    $o{'timestamp'}= $ENV{'YPPSC_DATA_TIMESTAMP'} or die;
 
     my $tf= pipethrough_prep();
     write_tsv($tf);
@@ -446,10 +447,10 @@ sub main__uploadyaarg () {
                    Content_Type => 'application/octet-stream',
                    Content => $oz ];
 
-    my $dest= $ENV{'YPPSC_YARRG_YARRG'};
-
-    my $respcontent= cgipostform($ua, "$dest/commod-update-receiver", \%o);
+    my $respcontent= yarrgpostform($ua, \%o);
     $respcontent =~ m/^OK\b/ or die "$respcontent ?";
+    $respcontent =~ s/^/ /mg;
+    print $respcontent,"\n";
 }
 
 sub main__uploadpctb () {