- while($file =~ m/(Metal|Crystal|Eonium)\D+(\d+)\D+(\d+)/g){
- my $id = $dbh->selectrow_array($addpdata,undef,$planet,$tick
- ,'roid',$1, $2) or die $dbh->errstr;
- $pdatascan->execute($id,$scan->{id});
- $id = $dbh->selectrow_array($addpdata,undef,$planet,$tick
- ,'resource',$1, $3) or die $dbh->errstr;
- $pdatascan->execute($id,$scan->{id});
+ while($file =~ m/"center">(Metal|Crystal|Eonium)\D+(\d+)\D+([\d,]+)/g){
+ my ($roids,$res) = ($2,$3);
+ $roids =~ s/,//g;
+ $addpdata->execute($planet,$tick,$scan->{id}
+ ,'roid',$1, $roids) or die $dbh->errstr;
+ $res =~ s/,//g;
+ $addpdata->execute($planet,$tick,$scan->{id}
+ ,'resource',$1, $res) or die $dbh->errstr;
+ }
+ if($file =~ m{<td class="center">([A-Z][a-z]+)</td><td class="center">([A-Z][a-z]+)</td><td class="center">([A-Z][a-z]+)</td>}){
+ $addpdata->execute($planet,$tick,$scan->{id}
+ ,'planet','Light Usage', $production{$1}) or die $dbh->errstr;
+ $addpdata->execute($planet,$tick,$scan->{id}
+ ,'planet','Medium Usage', $production{$2}) or die $dbh->errstr;
+ $addpdata->execute($planet,$tick,$scan->{id}
+ ,'planet','Heavy Usage', $production{$3}) or die $dbh->errstr;
+ }
+ if($file =~ m{<span class="superhighlight">([\d,]+)</span>}){
+ my $res = $1;
+ $res =~ s/,//g;
+ $addpdata->execute($planet,$tick,$scan->{id}
+ ,'planet','Production', $res) or die $dbh->errstr;