From c277b02273b135595c8350934f398586226c1d1d Mon Sep 17 00:00:00 2001 From: Alexander Yakovlev Date: Wed, 19 Jul 2017 13:46:31 +0700 Subject: [PATCH] put time as soon as we post updates --- bot.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bot.php b/bot.php index 1b31363..01c5151 100644 --- a/bot.php +++ b/bot.php @@ -101,6 +101,9 @@ foreach ($articles as $article) { 'parse_mode' => 'Markdown' ]); unset($tdescription); + if (!$config['DRY_RUN']) { + file_put_contents('.lastrun', time()); + } } catch (Longman\TelegramBot\Exception\TelegramException $e) { echo $e; } @@ -120,12 +123,12 @@ foreach ($articles as $article) { $mdescription .= $attachment->url; }*/ $mastodon->status_post($mdescription); + if (!$config['DRY_RUN']) { + file_put_contents('.lastrun', time()); + } } } else { echo $description."\n"; echo $link; } } -if (!$config['DRY_RUN']) { - file_put_contents('.lastrun', time()); -}