sub refresh_commodmap() {
my $ua= LWP::UserAgent->new;
- my $resp= $ua->get("$pctb/commodmap.php");
+ my $resp= $ua->get("$pctb/commodmap.php?version=2");
die $resp->status_line unless $resp->is_success;
my $cdata='';
}) or die;
my $content= $resp->content;
- # hacks to strip off drivel that seems to have been added!
- $content =~ s/^.*\n(\<\?xml)/$1/s;
- $content =~ s/\<\/body\>.*//s;
# print STDERR "[[[$content]]]\n";
$xp->parse($content);
close $o or die $!;
$current= $commod{$commod};
my $l= bs_p($commod,$bs,$sortmul);
next unless @$l;
-#print STDERR "COMMOD $commod @$l\n";
-
+#print STDERR "COMMOD $commod has ".scalar(@$l)."\n";
+ $o .= writeint($commodmap{$commod});
$o .= writeint(scalar @$l);
foreach my $cs (@$l) {
$stall= $cs->{Stall};
if (!defined $stallix) {
push @stallmap, $stall;
$stallmap{$stall}= $stallix= @stallmap;
+#print STDERR "STALL DEF $stallix $stall\n";
}
my $qty= $cs->{Qty};
$qty =~ s/^\>\s*//;
$o .= writeint($stallix, $cs->{Price}, $qty+0);
+ $count++;
}
- $count++;
}
#print STDERR "COMMOD $commod COUNT WAS $count\n";
return