Hello there!
Welcome to the source page of u/prequelmemes_bot! Nice to meet you. First of all, let me talk you through what the bot does and details later. If you want to help the bot, please go down to the TODO list and find your way to contribute! Thanks!
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
What you need is just basic installation of docker and its enabled state.
sudo apt-get update
sudo apt-get install docker docker-engine docker.io
sudo systemctl start docker
sudo systemctl enable docker
This will install docker on your machine and enable the docker daemon.
The only thing that needs to be done before execution is the config. The only thing that needs to be done before execution is the config profile. In the config profile you should fill your Reddit API details.
For that please follow the steps below
git clone https://github.com/thecsw/prequelmemes_bot.git
cd prequelmemes_bot
mv .env.example .env
nano .env
After filling out the details, save and exit. You’re done with installation.
In order to deploy the bot, you should have configured the .env
file. Now, we
need to build the containers and set them running. Commands below will do the
building and deployment. The build stage might take several minutes to download
and install all the required dependencies. The time taken directly depends on
your hardware. The maintenance details are in the next part.
NOTE You also should have configured docker, so you can run docker-compose
and docker
commands without sudo privileges. Read docker manuals or google how
to add a user to docker group.
docker-compose build -t prequelmemes_bot
docker-compose up -d
That is everything. All the prequelmemes will be identified. Once and for all, the archives will never be incomplete.
This will just start all services in detached mode.
docker-compose up -d
Do not use the down
command as it will wipe out created containers and
images. This may cost you your database data. If you want to down
the bot,
backup it first. However, the command below will just stop active services and
will keep the images and containers. After that, you can fire it up again.
docker-compose stop
This command will restart all services.
docker-compose restart
To check how the bot is doing, use the command below to view an output from all active services.
docker-compose logs
I wrote a little bash script that will copy the database contents and dump them
into a file. You need to configure the backup.sh.example
file first.
./backup.sh
The ./src
folder on the host machine is volumed with ./src
folder in the
container for the service bot. There is no need for rebuilding if the source
code has changed. The following command will update the source code and restart
the services.
git pull && docker-compose restart
The code is heavily commented and all the important modules are being separated into different files. Looks pretty, dunno.
- Docker is the company driving the container movement and the only container platform provider to address every application across the hybrid cloud.
- praw is Python Reddit API Wrapper. This will be the main and only package to connect to Reddit’s API and extract desired data.
- python-opencv is used for image transformations and computer vision problems.
- pytesseract is a python wrapper for Google’s Tesseract-OCR.
- Pillow is the Python Imaging Library by Fredrik Lundh and Contributors.
- pysrt is a Python library used to edit or create SubRip files.
This project is licensed under the The GNU General Public License (see the LICENSE file for details), it explains everything pretty well.
- Sagindyk Urazayev - Core Developer. Back-end. - thecsw
- farhank3389 - Fixes - farhank3389
This is going to be a short todo list. If you have the true loyalty and some free time, try to add/fix the following todo items or add your own with the issues tab or push.
I don’t have an idea of what to do. I made some prototypes, don’t know. If the bot is going to answer to each comment, that is just a spam.
I find it pretty practical to run the bot in an isolated container instead on a host machine. This whole thing may take a while… SQLite is a good approach for some mobile applications and so on but it is bad if you have a lot of data and want to be somewhat professional. I might go with MySQL or PostgreSQL. This is a really bad logging approach, I need to get rid of the ASCII tables. Add some little new features, replace old ones with new ones. Make a faster version. Just a general quality assurance. The message body text isn’t perfect. It can be more prequelmemed. So yeah, if somebody can do it, that would be awesome. Just port the whole code. I am not talking about just usingpython3 main.py
instead of python main.py
. I am talking about using the new python3+
features. Like better string formatting, like the print(f"{args}...")
.
tqdm is throwing some strange annoying warnings. Will need a more manual way
of counting things.