mirror of
https://github.com/twisterarmy/twister-rss-bot.git
synced 2025-02-01 01:24:25 +00:00
implement user post K value detection
This commit is contained in:
parent
7a7c69231b
commit
508ae759e7
@ -135,6 +135,24 @@ foreach ($config->feed as $feed)
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Get post k
|
||||||
|
$k = 0;
|
||||||
|
|
||||||
|
if ($posts = $client->getPosts([$feed->target], 1))
|
||||||
|
{
|
||||||
|
if (isset($posts[0]['userpost']['k']))
|
||||||
|
{
|
||||||
|
$k = (int) $posts[0]['userpost']['k'] + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$k)
|
||||||
|
{
|
||||||
|
echo _('Could not get user post K value') . PHP_EOL;
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Send each message to the twister account
|
// Send each message to the twister account
|
||||||
foreach ($query->fetchAll() as $queue)
|
foreach ($query->fetchAll() as $queue)
|
||||||
{
|
{
|
||||||
@ -142,7 +160,7 @@ foreach ($config->feed as $feed)
|
|||||||
|
|
||||||
$twister->newPostMessage(
|
$twister->newPostMessage(
|
||||||
$feed->target,
|
$feed->target,
|
||||||
time(), //int $k,
|
$k,
|
||||||
$queue->message,
|
$queue->message,
|
||||||
$errors
|
$errors
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user