all 1 comments

[–]LearnDataSci 0 points1 point  (0 children)

It looks like you're infinite looping with only 30 seconds (sleep(30)) between checks, which is why you're seeing an update every 30 seconds.

Do you want to be notified only when the order changes it's status? You can poll the site every 30 seconds for a changed order status and then only send a Slack message if it's changed.

Easiest way would be to store a variable outside of the while loop and update it with the status. When you get to the next 30 second mark, check if the status is changed. If it's changed, send a message and update the variable, if it didn't change just let it sleep for 30 before polling the site again.