From 305befd2f03428031ffc07a481863943a67c4281 Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 21 Dec 2023 08:35:10 +0200 Subject: [PATCH] fix post counting --- src/cli/bot.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/cli/bot.php b/src/cli/bot.php index 22fa05b..fe20bee 100644 --- a/src/cli/bot.php +++ b/src/cli/bot.php @@ -143,21 +143,16 @@ foreach ($config->feed as $feed) ); // Get post k - $k = 0; + $k = 1; if ($posts = $twister->getPosts([$feed->target], 1)) { - if (isset($posts[0]['userpost']['k'])) + if (isset($posts['result'][0]['userpost']['k'])) { - $k = (int) $posts[0]['userpost']['k'] + 1; + $k = (int) $posts['result'][0]['userpost']['k'] + 1; } - } - - if (!$k) - { - echo _('Could not get user post K value') . PHP_EOL; - continue; + else continue; } // Send each message to the twister account