Running Shreddit periodically in the cloud with PythonAnywhere - x89/Shreddit GitHub Wiki

If you don't want to manually run Shreddit on your own computer, you can install it somewhere in the cloud. PythonAnywhere.com offers a free beginner account that lets you run Shreddit at a scheduled time every day.

You can sign up for a free account at: https://www.pythonanywhere.com/registration/register/beginner/

Setup instructions

  1. Sign up for a PythonAnywhere account, activate it, and log in.
  2. From the PythonAnywhere dashboard, open a bash console. You should be in your homedir (~/)
  3. Git clone https://github.com/x89/Shreddit.git into your homedir.
  4. Create a basic virtualenv using the following command: mkvirtualenv shreddit-env. You do not need to specify a Python version; the default 2.7 (as of November 2017) works fine.
  5. While in the virtualenv, set up Shreddit as per the readme.
  6. (Optional) Run Shreddit manually once, from the command line, just to make sure it's working.
  7. Once you confirm Shreddit is working, symlink praw.ini and shreddit.yml into your homedir. From ~/, use the commands ln -s ~/Shreddit/praw.ini and ln -s ~/Shreddit/shreddit.yml. This is for the next step, so the task scheduler can find these files.
  8. Leave the console (exit or just switch away, up to you). Back in the PythonAnywhere web dashboard, go to the "Tasks" tab. Add a new task. Schedule it to run at a time of your choosing and have it run the command ~/.virtualenvs/shreddit-env/bin/shreddit. It is important that you include the full virtual env path to the binary. For testing, maybe first schedule the task to run just a minute or two in the future and then check the logs afterward to make sure Shreddit successfully ran.