1
0
mirror of https://github.com/serega404/VodokanalBot.git synced 2025-04-21 14:30:46 +03:00
This commit is contained in:
Sergey Karmanov 2021-08-20 00:25:46 +03:00
parent 766356b3bb
commit 888b663520
Signed by: serega404
GPG Key ID: 97CADD982D88DF68

View File

@ -17,7 +17,7 @@ if (file_exists("db.json")) {
// get DOM from URL // get DOM from URL
$html = file_get_html($config['url']); $html = file_get_html($config['url']);
$all_elements; $all_elements = null;
$dateNow = date("d.m.Y"); $dateNow = date("d.m.Y");
echo "Date now: " . $dateNow . "\n"; echo "Date now: " . $dateNow . "\n";
@ -36,6 +36,11 @@ foreach ($html->find('td[bgcolor="#ffffff"]') as $e) {
} }
} }
if ($all_elements == null) {
echo "Posts not dound";
exit;
}
echo "The number of posts for this day: " . count($all_elements) . "\n"; echo "The number of posts for this day: " . count($all_elements) . "\n";
if ($db != null) { if ($db != null) {