jb-data.de/scripts/ajax/tanke1.php
2025-08-11 22:23:30 +02:00

30 lines
No EOL
943 B
PHP

<?php
error_reporting(E_ALL); ini_set('display_errors',0);
//-------------------------------------------------------------------------------------------------------------
$page='https://www.benzinpreis-aktuell.de/tanken-hem-tankstelle-leipzig-04347-4270.html'; $child=''; $node=''; $innerHTML= '';
$tag='div-2 preisC';
$html3 = file_get_contents($page);
mb_convert_encoding($html,"UTF-8","auto");
$xp3 = new DOMDocument();
$xp3->loadHTML($html3);
$xp3 = new DOMXPath($xp3);
foreach($xp3->query("//div[@class='".$tag."']") as $node) {
$node->nodeValue;
break;
};
$children = $node->childNodes;
foreach ($children as $child) {
$tanke11 .= $child->ownerDocument->saveXML( $child );
}
//echo "Data: ".$tanke11;
if (strlen($tanke11)!=0) { $tankex=$tanke11; } else { $tankex='close'; }
$template->assign('open', 1);
$template->assign('tanke', $tankex);
$template->assign('content', 'tpl/ajax/tanke.tpl');
?>