- tested on Python 3.4+
- Python libraries:
- Reddit API id, secret and refresh-token
To run the offline unit tests; clone this repo and:
pip install -r requirements.txt copy credentials.py.example credentials.py copy praw.ini.example praw.ini python3 test.py
To run the full tests, prepare your own
praw.ini and start tests using
python3 test.py online.
The test creates a
Running the bot
Make sure the online test is successful!
I use the
start.sh on my PI to run in background.
If you want to start it without script, no parameters are required to start it (
The script pipes startup errors to
err.txt. The bot logs to
bot.log once it is running.
There are JSON files included in this repository. If you want current data you can always recreate them using
While the bot is running, you can teach it new cards without stopping it. Create or edit
tempinfo.json in the data-directory or edit it in this git repository.
kill it on Linux to stop the bot gracefully.
Learning from this bot
A good starting point is
hearthscan-bot.py/main(). I've tried to comment the code and use consistent, self explaining names.
There are nice people out there answering questions (/r/learnpython, /r/redditdev) and the PRAW documentation is decent.
All code contained here is licensed by MIT.