chiark / gitweb /
Leave PCTB server text in #upload-1#.html
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 3 Jul 2009 17:58:00 +0000 (18:58 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 3 Jul 2009 17:58:00 +0000 (18:58 +0100)
pctb/README
pctb/commod-results-processor

index 231159c2f0a9a0d8f50f22a7adc35dabdd458a3c..e9f4f097b06adb1e6fe73a9c4a5a5b34766170a7 100644 (file)
@@ -100,6 +100,12 @@ The program reads and writes the following files:
    server.  This is fetched and updated automatically as necessary.
    It can safely be deleted as it will then be refetched.
 
    server.  This is fetched and updated automatically as necessary.
    It can safely be deleted as it will then be refetched.
 
+ * #upload-1#.html #upload-2#.html
+
+   We screenscrape the pages from the PCTB upload server.  The actual
+   HTML returned from the upload server is left in these dropping
+   files for debugging etc.
+
  * <file>.new
 
    When any of these tools overwrite one of the persistent dictionary
  * <file>.new
 
    When any of these tools overwrite one of the persistent dictionary
index 36473186a80f242a7a0fcece99f7d8db6c2ba72a..c54a23585a388b6bc7bb018a7be910e11a14a72d 100755 (executable)
@@ -387,6 +387,8 @@ sub main__genmarketdata () {
 }
 
 sub main__upload () {
 }
 
 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";
     die unless $pctb;
     my $o= genmarketdata();
     my $url= "$pctb/upload.php";
@@ -402,19 +404,22 @@ sub main__upload () {
 
     my $resptxt= $resp->content();
 
 
     my $resptxt= $resp->content();
 
+    open R, ">./#upload-1#.html" or die $!;
+    print R $resptxt or die $!;
+    close R or die $!;
+
     my @filenames= $resptxt =~
     my @filenames= $resptxt =~
- m/input\s+type="hidden"\s+name="filename"\s+value=\"([_.0-9a-z]+)\"/i;
-    @filenames or die "$resptxt ?";
+ m/input\s+type="hidden"\s+name="filename"\s+value=\"([_.0-9a-z]+)\"/ig;
+    @filenames or die;
 
     my @forcerls= $resptxt =~
 
     my @forcerls= $resptxt =~
- m/input\s+type="hidden"\s+name="forcereload"\s+value=\"([1-9]\d+)\"/i;
-    @forcerls or die "$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];
 
 
     my $filename= $filenames[0];
     my $forcerl= $forcerls[0];
 
-    die "$resptxt | @filenames ?" if grep { $_ ne $filename } @filenames;
-    die "$resptxt | @forcerls ?" if grep { $_ ne $forcerl } @forcerls;
+#print "[[[ $resptxt ]]]\n";
 
 #    my $setsland= {
 #      'action' => 'setisland'
 
 #    my $setsland= {
 #      'action' => 'setisland'
@@ -422,9 +427,9 @@ sub main__upload () {
 #      'forcereload' => $forcerl,
 #    my $url_setisland= "$url
 #
 #      'forcereload' => $forcerl,
 #    my $url_setisland= "$url
 #
-#http://pctb.ilk.org/upload.php?topisland=560&ocean=2&island=48&action=setisland&forcereload=1244748679&filename=PFayDW' >v.html 
+#http://pctb.ilk.org/upload.php?&ocean=2&island=48&action=setisland&forcereload=1244748679&filename=PFayDW' >v.html 
 #    
 #    
-    print ">$filename|$forcerl<\n";
+    print ">$filename|$forcerl|@oceanids|$islandid<\n";
 
     system 'printenv|grep YPP|sort';
 }
 
     system 'printenv|grep YPP|sort';
 }