Giter VIP home page Giter VIP logo

d-schmidt / hearthscan-bot Goto Github PK

View Code? Open in Web Editor NEW
12.0 3.0 8.0 2.54 MB

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

Home Page: https://www.reddit.com/user/hearthscan-bot

License: MIT License

Python 89.36% HTML 10.59% Shell 0.05%
reddit-bot praw reddit bot hearthstone

hearthscan-bot's Introduction

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.

hearthscan-bot's People

Contributors

d-schmidt avatar tobaloidee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hearthscan-bot's Issues

Logo proposal

Hey!
I am a designer want to make a design for this projects if you have any requirments then let me know.i just need a permission to work on it.
thanks

Database question

Hi!

I love your bot and its concept, and I'm aiming to make something similar for r/OnePiece.

My initial idea - and what I thought you did - was parse names off of a page (which would be https://onepiece.fandom.com/wiki/One_Piece_Wiki in my case) but I see you have it stored in a JSON locally.

So:

  1. Where do you get this JSON info from?
  2. Do you need to manually update it?
  3. Why not parse from a website instead?

Thanks a lot!

[QUESTION] Making praww publicly available

Hey!

My current Reddit bots only use the basic praw comment listener, but I see that you've created your own wrapper for listening to everything at once.

Would it be possible to upload this package to pip or would it be too much of a hassle to keep it maintained?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.