X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=pctb%2Fcommod-results-processor;h=4a70ddf7767376ab8b9db5406750c257460e9c3c;hb=64063c86071bbfc2de0fe032e372e1321c4b34e5;hp=3ea53be79f49b73a36b9be2f592a307a05b2833e;hpb=d5514a07ad8470e0c00f158ef0a02ff6a90adb22;p=ypp-sc-tools.db-live.git diff --git a/pctb/commod-results-processor b/pctb/commod-results-processor index 3ea53be..4a70ddf 100755 --- a/pctb/commod-results-processor +++ b/pctb/commod-results-processor @@ -224,7 +224,7 @@ our ($ua)= LWP::UserAgent->new; sub load_commodmap() { undef %commodmap; - my $c= new IO::File "#commodmap#.tsv"; + my $c= new IO::File "_commodmap.tsv"; if (!$c) { $!==&ENOENT or die $!; return; } while (<$c>) { m/^(\S.*\S)\t(\d+)\n$/ or die "$_"; @@ -244,7 +244,7 @@ sub refresh_commodmap() { my $incommodmap=0; my $intag=''; my %got; - my $o= new IO::File "#commodmap#.tsv.tmp",'w' or die $!; + my $o= new IO::File "_commodmap.tsv.tmp",'w' or die $!; undef %commodmap; my $xp= new XML::Parser @@ -292,7 +292,7 @@ sub refresh_commodmap() { # print STDERR "[[[$content]]]\n"; $xp->parse($content); close $o or die $!; - rename "#commodmap#.tsv.tmp","#commodmap#.tsv" or die $!; + rename "_commodmap.tsv.tmp","_commodmap.tsv" or die $!; } our %newcommods; @@ -317,7 +317,7 @@ sub refresh_newcommods() { my $rsync= $ENV{'YPPSC_PCTB_RSYNC'}; $rsync= 'rsync' if !defined $rsync; - my $local= "#master-newcommods#.txt"; + my $local= "_master-newcommods.txt"; my $src= $ENV{'YPPSC_PCTB_DICT_UPDATE'}; if ($src) { my $remote= "$src/master-newcommods.txt"; @@ -325,7 +325,7 @@ sub refresh_newcommods() { die "$? $!" if $! or $?; } read_newcommods($local); - read_newcommods('#local-newcommods#.txt'); + read_newcommods('_local-newcommods.txt'); } our (%stallmap, @stallmap); @@ -430,7 +430,7 @@ sub main__genmarketdata () { sub save_upload_html ($$) { my ($which, $resptxt) = @_; - open R, ">./#upload-$which#.html" or die $!; + open R, ">./_upload-$which.html" or die $!; print R $resptxt or die $!; close R or die $!; } @@ -449,7 +449,7 @@ sub main__upload () { ] }; - print STDERR "Uploading data to server...\n"; + print STDERR "Uploading data to $pctb...\n"; my $resp= $ua->post("$url", Content => $content, Content_Type => 'form-data'); @@ -458,7 +458,7 @@ sub main__upload () { my $resptxt= $resp->content(); save_upload_html('1', $resptxt); - open R, ">./#upload-1#.html" or die $!; + open R, ">./_upload-1.html" or die $!; print R $resptxt or die $!; close R or die $!; @@ -514,7 +514,7 @@ sub main__upload () { save_upload_html('3', $resptxt); print "\n" or die $!; - system('w3m -T text/html -dump < \#upload-3#.html'); + system('w3m -T text/html -dump < _upload-3.html'); print "\n" or die $!; }