parsing optimiert

This commit is contained in:
Göran Heinemann 2020-03-08 22:47:54 +01:00
parent 2b339b8b45
commit 41678d3373

View File

@ -2,7 +2,7 @@
<?php
include "config.php";
$sql = "SELECT * FROM scans WHERE site=2";
$sql = "SELECT * FROM scans WHERE site=2 and parsed=0";
//$sql = "SELECT * FROM scans WHERE id=(SELECT MAX(id) FROM scans WHERE site=2)";
$stmt = $pdo->query($sql);
$data = $stmt->fetchAll(PDO::FETCH_ASSOC);
@ -22,9 +22,9 @@ foreach ($data as $scan){
$country = array();
$p2 = $parts[$i]->childNodes;
$country[] = $p2[0]->textContent;
for ($j=0; $j < $p2->length; $j++){
/*for ($j=0; $j < $p2->length; $j++){
var_dump($p2[$j]->textContent);
}
}*/
$deaths = (strpos($p2[6]->textContent, "+") !== false?$p2[8]->textContent:$p2[6]->textContent);
$active = (strpos($p2[6]->textContent, "+") !== false?$p2[16]->textContent:$p2[10]->textContent);
$country[] = intval(str_replace(",", "", $p2[2]->textContent));