- Mitglied seit
- 16 Feb 2006
- Beiträge
- 657
- Punkte für Reaktionen
- 34
- Punkte
- 28
thx to JL3:
Zeigt den niedrigsten Spritpreis zu den in der Konfiguration hinterlegten Daten an
Erstellung/Installation: Datei mit unten stehenden Namen und Inhalt im SaS Webverzeichnis erstellen.
Dateiname: pseudosprit.php
Zeigt den niedrigsten Spritpreis zu den in der Konfiguration hinterlegten Daten an
Erstellung/Installation: Datei mit unten stehenden Namen und Inhalt im SaS Webverzeichnis erstellen.
Dateiname: pseudosprit.php
PHP:
<?php
/*
+---------------------------------------------------------------------+
| |
| SensorAndSwitch Automation Pro |
| PseudoGerä-Script |
| =============================================================== |
| -> Sprit |
| tankentanken.de |
| |
+---------------------------------------------------------------------+
*/
error_reporting(0);
include "include/includedateien.php";
include "include/includefunctions.php";
include "include/includeconf.php";
include "include/includeconfig.php";
include "include/includedefine.php";
$PLZStadt="Umkreis";
$Benzin="supere5"; # Möchkeiten: supere5, supere10, diesel
$km="5"; # Such-Umkreis in km
$url='http://www.tankentanken.de/suche/'.$Benzin.'/'.$km.'/'.$PLZStadt.'/'.BREITENGRAD.'/'.LAENGENGRAD;
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$Status = curl_exec($ch);
curl_close($ch);
if ($Status) {
$x=$Status;
do {
$x=substr($x,strpos($x,'<div class="price">')+19);
$x=substr($x,strpos($x,'<div class="price">')+19);
$Preis=substr($x,0,4);
$Name=substr($x,strpos($x,'<div class="name">')+18);
$Tanke=explode("<",$Name);
$T=explode("|",$Tanke[0]);
$T[0]=trim($T[0]);
$T[1]=trim($T[1]);
} while ($Preis=="-.--");
echo "P#".'<div style="font-size:26px;text-align:right;width:310px;position:relative;top:-15px;">'.strtoupper($Benzin).": ".$Preis."9 .".'</div><div style="font-size:20px;text-align:right;width:310px;position:relative;top:-15px;">'.$T[0].", ".$T[1].'</div>'."*HTML#";
}
else {
echo "P##E##";
}
exit;
?>
Zuletzt bearbeitet: