chiark / gitweb /
Leave PCTB server text in #upload-1#.html
[ypp-sc-tools.web-live.git] / pctb / commod-results-processor
index b604419db6cf7c3e43531fda9350fbd0eb9affea..c54a23585a388b6bc7bb018a7be910e11a14a72d 100755 (executable)
@@ -387,10 +387,11 @@ sub main__genmarketdata () {
 }
 
 sub main__upload () {
+    my $ocean= $ENV{'YPPSC_OCEAN'};  die unless $ocean;
+    my $island= $ENV{'YPPSC_ISLAND'};  die unless $island;
     die unless $pctb;
     my $o= genmarketdata();
     my $url= "$pctb/upload.php";
-    $url= "http://www.chiark.greenend.org.uk/ucgi/~ijackson/check/upload.php";
     my $content= {
        'marketdata' => [ undef, "marketdata.gz",
                          Content_Type => 'application/gzip',
@@ -401,7 +402,36 @@ sub main__upload () {
                        Content_Type => 'form-data');
     die $resp->status_line unless $resp->is_success;
 
-    print "[[ ",$resp->content," ]]\n";
+    my $resptxt= $resp->content();
+
+    open R, ">./#upload-1#.html" or die $!;
+    print R $resptxt or die $!;
+    close R or die $!;
+
+    my @filenames= $resptxt =~
+ m/input\s+type="hidden"\s+name="filename"\s+value=\"([_.0-9a-z]+)\"/ig;
+    @filenames or die;
+
+    my @forcerls= $resptxt =~
+ m/input\s+type="hidden"\s+name="forcereload"\s+value=\"([1-9]\d+)\"/ig;
+    @forcerls or die;
+
+    my $filename= $filenames[0];
+    my $forcerl= $forcerls[0];
+
+#print "[[[ $resptxt ]]]\n";
+
+#    my $setsland= {
+#      'action' => 'setisland'
+#      'filename' => $filename,
+#      'forcereload' => $forcerl,
+#    my $url_setisland= "$url
+#
+#http://pctb.ilk.org/upload.php?&ocean=2&island=48&action=setisland&forcereload=1244748679&filename=PFayDW' >v.html 
+#    
+    print ">$filename|$forcerl|@oceanids|$islandid<\n";
+
+    system 'printenv|grep YPP|sort';
 }