|
|
@ -18,7 +18,7 @@ |
|
|
|
* tgBotOwner: <hier DEINE Telegram-ID eintragen> |
|
|
|
* tgBotOwner: <hier DEINE Telegram-ID eintragen> |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
function worker(string $response) |
|
|
|
function worker(string $response, array $config) |
|
|
|
{ |
|
|
|
{ |
|
|
|
$tomorrow = (new DateTime('tomorrow'))->format('d.m.Y'); |
|
|
|
$tomorrow = (new DateTime('tomorrow'))->format('d.m.Y'); |
|
|
|
$trashArr = str_getcsv($response, "\n"); |
|
|
|
$trashArr = str_getcsv($response, "\n"); |
|
|
@ -99,10 +99,10 @@ if ($response !== false) { |
|
|
|
file_put_contents($muellFile, $response); |
|
|
|
file_put_contents($muellFile, $response); |
|
|
|
|
|
|
|
|
|
|
|
// Go on with checking the result data |
|
|
|
// Go on with checking the result data |
|
|
|
worker($response); |
|
|
|
worker($response, $config); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (file_exists($muellFile)) { |
|
|
|
if (file_exists($muellFile)) { |
|
|
|
worker(file_get_contents($muellFile)); |
|
|
|
worker(file_get_contents($muellFile), $config); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
shell_exec(sprintf("echo Müllbot konnte keine Daten empfangen | %s -u %d", $config['pathBot'], $config['tgBotOwner'])); |
|
|
|
shell_exec(sprintf("echo Müllbot konnte keine Daten empfangen | %s -u %d", $config['pathBot'], $config['tgBotOwner'])); |
|
|
|
} |
|
|
|
} |
|
|
|