Automatically Dispatch Telegram Bot Notifications

PHP outputs tweets with over 10 likes, yet the Telegram bot repeatedly resends older posts when no new tweet exists. How can I fix this?

<?php
if ($entry['score'] > 10) { sendMsg('YOUR_TOKEN', 'YOUR_CHANNEL', $entry['msg']); }
?>

hey try storing the last tweet id and check if its new before sending the msg. i had that problem too and adding the id check stopped the duplicate notifications. hope it helps!

I experienced a similar issue when trying to manage notifications from tweets. In my solution, I decided to store the timestamp of the last notified tweet in a persistent storage like a file or database, which made it easier to compare against new tweets. Every time a tweet came in, I would check if its timestamp was more recent than the stored one before triggering the notification. This not only prevented duplicate messages but also ensured that even if tweet IDs were reused somehow, only fresh content would be sent. This approach simplified state management and reduced redundant notifications.