Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

πŸ™πŸ˜πŸ¦πŸ‰πŸ”₯πŸ¦…πŸπŸΊ This bot explained cards in reddit.com/r/hearthstone before Reddit killed 3rd party apps. Archived after 8 years on 1.7.2023

License

d-schmidt/hearthscan-bot

Repository files navigation

hearthscan-bot

Explaining cards in reddit.com/r/hearthstone.
To see the bot in action send a PM containing [[Ragnaros]] to /u/hearthscan-bot

Requirements

  • tested on Python 3.4+
  • Python libraries: requests, praw, lxml
  • Reddit API id, secret and refresh-token

Tests

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 credentials.py and praw.ini and start tests using python3 test.py online.
The test creates a test.log.

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 (python3 hearthscan-bot.py).
The script pipes startup errors to std.txt and 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 scrape.py.

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.

Delete the lockfile.lock or 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.

License

All code contained here is licensed by MIT.

About

πŸ™πŸ˜πŸ¦πŸ‰πŸ”₯πŸ¦…πŸπŸΊ This bot explained cards in reddit.com/r/hearthstone before Reddit killed 3rd party apps. Archived after 8 years on 1.7.2023

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published