# parser_from_interneturok
Chat-robot Telegram for parsing homeworks by subject name, grade and number of the week
## Funny story of development
The customer of this project **refused to pay** the second half of the payment for the work and wanted to steal my code.
I managed to delete all the code from the server, then i changed passwords on all **40 accounts** that were planned to be used in this chat-robot.
Thus **i destroyed the entire mini-business** of this customer.
## Dependencies
1. [PHP 8.4](https://www.php.net/releases/8.4/en.php)
2. [Composer](https://getcomposer.org/) (php package manager)
3. [MINIMAL](https://git.svoboda.works/mirzaev/minimal) (PHP framework)
5. [Zanzara](https://github.com/badfarm/zanzara) (Telegram framework + ReactPHP)
6. [Baza](https://git.svoboda.works/mirzaev/baza) (binary database)
7. [NGINX](https://nginx.org/en/) (web server) *(can be replaced)*
8. [SystemD](https://systemd.io/) (service manager) *(can be replaced)*
You can find other dependencies in the file `/composer.json`
## Installation
### SystemD (or any alternative you like)
You can copy an example of systemd file from here: `/examples/systemd/ parser_from_interneturok-telegram.service`
**Execute:** `sudo cp parser_from_interneturok-telegram.service /etc/systemd/system/ parser_from_interneturok-telegram.service && sudo chmod +x /etc/systemd/system/ parser_from_interneturok-telegram.service`
*before you execute the command think about **what it does** and whether the **paths** are specified correctly*
*the configuration file is very simple and you can remake it for any alternative to SystemD that you like*
### InternetUrok accounts
Fill in the file: `/mirzaev/parser_from_interneturok/system/storage/accounts.csv`
**Format:** "mail password" (**separated by 1 space symbol**)
```CSV
mail password
mail password
mail password
```
### Authorized Telegram accounts
Fill in the file: `/mirzaev/parser_from_interneturok/system/settings/accounts.php`
```php
return [
1053489457, // Arsen Mirzaev Tatyano-Muradovich @redloser
]
```
You can get the telegram account identifier by [@RawDataBot](https://t.me/RawDataBot)
### Chat-robot Telegram token
Fill in the file: `/mirzaev/parser_from_interneturok/system/settings/telegram.php`
You can get the chat-robot telegram token by [@BotFather](https://t.me/BotFather)