https://github.com/accessd/kdmid-bot
https://github.com/accessd/kdmid-bot
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/accessd/kdmid-bot
- Owner: accessd
- Created: 2022-08-08T15:11:35.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-23T18:16:43.000Z (7 months ago)
- Last Synced: 2025-01-21T00:05:31.085Z (3 months ago)
- Language: Ruby
- Size: 13.7 KB
- Stars: 13
- Watchers: 2
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Kdmid bot
Checks ability to make an appointment to consul
## Setup
Register on https://2captcha.com/ and get API key.
Get order id and code from the link http://istanbul.kdmid.ru/queue/OrderInfo.aspx?id=ORDER_ID&cd=CODE
Create .env file and replace variables with your values:
```sh
cp .env.example .env
```### Docker
```sh
bin/build && bin/start
```Run bot with:
```sh
bin/bot
```#### Несколько заявлений
Если у вас несколько заявлений, создайте `.env.` и `compose..yml` файлы для каждого заявления и запускайте с подключением патча:
```sh
docker compose -f docker-compose.yml -f compose..yml up bot
```Либо добавить отдельные сервисы в основной файл.
**How to see the browser?**
View the firefox node via VNC (password: secret):
```sh
open vnc://localhost:5900
```> **_NOTE:_** If you want to access VNC via any public network interface you will need to update listening address in `docker-compose.yml` for `node-firefox` service
After testing that bot works properly put command to run bot in crontab, like:
> **WARNING:** Внимание! При повторяющихся запросах к системе в течение дня более 24 раз Ваша заявка будет заблокирована.
```sh
0 12 * * * root cd /path/to/the/bot; bin/bot >> kdmid-bot.log 2>&1
```Than you can look at the log file by:
```sh
tail -f kdmid-bot.log
```### Locally
Install ruby 3.1.2 with rbenv for example.
Install browser and driver: http://watir.com/guides/drivers/
You can use firefox with geckodriver.Setup dependencies:
```sh
bundle
```Run bot with:
```sh
ruby bot.rb
```## Issues
Problems with hcaptcha: do not pass it periodically