1
0
mirror of https://github.com/serega404/VodokanalBot.git synced 2026-05-30 12:10:01 +03:00

Вынес парсер в отдельный файл

This commit is contained in:
2026-05-29 01:03:07 +03:00
parent 23ab8113cf
commit 6f2b27f00e
7 changed files with 186 additions and 105 deletions
+18
View File
@@ -23,6 +23,24 @@ docker run -d --name VodokanalBot \
docker compose up -d --build
```
## Интеграции
Общая логика парсинга, работы с `data/db.json` и поиска новых сообщений вынесена в [`parser.py`](./parser.py).
Для новой интеграции достаточно создать свой адаптер отправки и передать его в `publish_new_posts`:
``` Python
from parser import create_session, publish_new_posts
session = create_session()
publish_new_posts(
send_message=lambda message: print(message),
session=session,
url="http://www.tgnvoda.ru/avarii.php",
)
```
## Библиотеки
* [Requests](https://requests.readthedocs.io/en/latest/)