This program allows user to set schedule liker for badoo dating service (https://badoo.com).
It uses python and selenium (pom) to emulate user behaviour.
- python 3.7+
- selenium-grid
- docker (>=18.0)
- docker-compose (>= 1.22)
- zalenium
- chromedriver
- yaml config setup
- pytest
Please use official docker vyahello/badoo-like
image and docker-compose setup for common usage.
docker run --rm vyahello/badoo-liker:2.2.3
It uses zalenium so you can check what's going on in the browser via http://localhost:4444/grid/admin/live endpoint.
To get latest setup.yaml
config file, please start the command below:
docker run --rm vyahello/badoo-liker:2.2.3 get-setup > setup.yaml
Please make sure
grid-url
is set tohttp://localhost:4444/wd/hub
To get latest docker-compose.yaml
config file, please start command below:
docker run --rm vyahello/badoo-liker:2.2.3 get-compose > docker-compose.yaml
Please use docker-compose.yaml file to run badoo liker script in docker with:
docker-compose up <service> # run some service e.g 'help' or 'single-scheduler'
docker compose up -d <service> # run in background
docker logs <service> # see recent logs
docker compose down # shutdown badoo runner
For instance, below is a sample of execution via docker-compose
:
docker-compose up single-scheduler
Creating network "badoo-liker_default" with the default driver
Creating selenium-hub ... done
Creating badoo-liker_chrome-node_1 ... done
Creating badoo-scheduler ... done
Attaching to badoo-scheduler
badoo-scheduler | Still waiting for the Grid ...
badoo-scheduler | Still waiting for the Grid ...
badoo-scheduler | [2019-10-13 14:37:06 INFO] Operating 15 badoo like attempts, in progress ...
badoo-scheduler | [2019-10-13 14:38:21 INFO] 15 badoo like attempts were successfully completed, please check your messages!
badoo-scheduler exited with code 0
You can run infinite scheduler
with command below:
docker-compose up infinite-scheduler
Please follow docker-selenium instructions.
Before execution please configure badoo config setup file template-setup.yaml.
Please make sure
grid-url
is set tohttp://localhost:9515
For local execution you have to download chromedriver (as we support Chrome only
for now) & run it from the cli:
chromedriver
We use selenium-grid to make it compatible with different OS/browsers (in future).
Then just run script from the root directory of the project:
python liker.py --help
usage: liker.py [-h] [--config CONFIG]
This program allows to run badoo liker service.
optional arguments:
-h, --help show this help message and exit
--config CONFIG, -c CONFIG
Setup badoo config file (e.g `setup.yaml`)
You'll get next output:
[2019-10-07 22:11:39 INFO] Operating 25 badoo like attempts, in progress ...
[2019-10-07 22:13:11 INFO] 25 badoo like attempts were successfully completed, please check your messages!
Scheduler
To be able to run script on schedule basis please configure run-scheduler.sh shell script with corresponding
pre-setup
configuration values in it.
./run-scheduler.sh -h
This script provides badoo executor scheduler. Delay is set to "1800" seconds between run.
Please use next commands:
- 'counted-executor' to run executor certain amount of time e.g '100'
- 'infinite-executor' to run executor infinite period of time (it will run until script is crashed)
- 'infinite-executor-background' to run executor infinitely in a background.
Logs will be saved in 'logs.txt' file automatically
Please see 'logs.txt' file for additional logs info.
There are two docker images
to maintain execution via docker:
- Base image
Base image contains all core
required packages/dependencies for fresh code install.
To build and push image please use command below:
docker build --no-cache -t vyahello/badoo-liker-base:<new version here> -f Dockerfile.base . && \
docker push vyahello/badoo-liker-base:<new version here>
- Main image
This image is aimed to run badoo-liker from docker.
To build and push image please use the command below ( may be some 0.1.0
version):
docker build --no-cache -t vyahello/badoo-liker:<new version here> . && \
docker push vyahello/badoo-liker:<new version here>
Please execute the next command from the root directory of a project:
pytest
- Clone the repository
- Configure
git
for the first time after cloning with yourname
andemail
pip install -r requirements.txt
to install all project dependenciespip install -r requirements-dev.txt
to install all development project dependencies- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request