You need to replace your webhook URL in the script.
This is how you can create slack webhook: https://api.slack.com/messaging/webhooks
And this is how you can schedule a local automation:
This will make sure your script runs on a set time. You can also run it on a VPS if you want.