Set up scheduling
For our free once per day bot,
- Add a file called send_tweet.sh to the hello-world-bot directory with the following contents:
cd /home/$USER/hello-world-bot/ python3 bot.py
- On the bash console, make sure you're in the hello-world-bot directory and run
This will give PythonAnywhere permission to run the script.
chmod +x send_tweet.sh
- Visit the "Schedule" tab on PythonAnywhere
- Add a new scheduled task which points to /home/[your username]/hello-world-bot/send_tweet.sh and runs within the next couple of minutes. Note that the system time is in the UTC timezone, which may not be the same as your own timezone!
- You'll be able to tell if the scheduled task is working correctly if a tweet is posted at the time you configured it for. If something went wrong, you can remove the task and set it up again with a different time.