init
This commit is contained in:
commit
72a26edcff
22092 changed files with 2101903 additions and 0 deletions
37
scripts/ajax/tanke1_clever.php
Normal file
37
scripts/ajax/tanke1_clever.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
error_reporting(E_ALL); ini_set('display_errors',0);
|
||||
|
||||
$date = getdate(); $open=1;
|
||||
if ($date['wday']!=0) {
|
||||
if ($date['hours']<5) { $open=0; }
|
||||
if ($date['hours']>22) { $open=0; }
|
||||
}
|
||||
if ($date['wday']==0) {
|
||||
if ($date['hours']<7) { $open=0; }
|
||||
if ($date['hours']>22) { $open=0; }
|
||||
}
|
||||
$template->assign('open', $open);
|
||||
if ($open==1) {
|
||||
//-------------------------------------------------------------------------------------------------------------
|
||||
$page='https://www.clever-tanken.de/tankstelle_details/28391'; $child=''; $node=''; $html= '';
|
||||
$tag='price-field';
|
||||
$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) {
|
||||
$tanke1 .= $child->ownerDocument->saveXML( $child );
|
||||
}
|
||||
|
||||
}
|
||||
$template->assign('tanke', $tanke1);
|
||||
$template->assign('content', 'tpl/ajax/tanke.tpl');
|
||||
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue