2022-05-01 22:45:55 +00:00
|
|
|
# Telegram RSS Bot
|
2022-05-02 00:03:00 +00:00
|
|
|
|
|
|
|
[![Build Status](https://ci.skobk.in/api/badges/Miroslavsckaya/tg_rss_bot/status.svg)](https://ci.skobk.in/Miroslavsckaya/tg_rss_bot)
|
|
|
|
|
2022-05-01 22:45:55 +00:00
|
|
|
## Setting up virtual environment
|
|
|
|
|
|
|
|
To be able to isolate project environment we'll use
|
|
|
|
[Python's venv](https://docs.python.org/3/library/venv.html).
|
|
|
|
|
|
|
|
### Setting up new environment and installing dependencies
|
|
|
|
|
|
|
|
```shell
|
|
|
|
# Create VirtualEnv directory
|
|
|
|
python -m venv ./.venv
|
|
|
|
# Loading environment
|
|
|
|
source .venv/bin/activate
|
|
|
|
# Installing dependencies
|
|
|
|
pip install -r requirements.txt
|
|
|
|
```
|
|
|
|
|
|
|
|
### Adding dependencies
|
|
|
|
|
|
|
|
```shell
|
|
|
|
# Installing new dependency
|
|
|
|
pip install somedependency
|
|
|
|
# Rewriting dependency file
|
|
|
|
pip freeze > requirements.txt
|
|
|
|
```
|
|
|
|
|
|
|
|
**Do not forget** to install the latest dependencies before adding new dependencies and rewriting
|
|
|
|
the `requirements.txt` file. Otherwise old dependencies could be lost.
|
2022-05-30 20:54:26 +00:00
|
|
|
|
|
|
|
## Running the bot
|
|
|
|
|
|
|
|
```shell
|
2022-07-13 22:53:53 +00:00
|
|
|
export RSSBOT_TG_TOKEN=xxx
|
|
|
|
export RSSBOT_DSN=xxx
|
2022-05-30 20:54:26 +00:00
|
|
|
python bot.py
|
|
|
|
```
|
2022-07-10 14:40:19 +00:00
|
|
|
## Running the update
|
|
|
|
|
|
|
|
```shell
|
2022-07-13 22:53:53 +00:00
|
|
|
export RSSBOT_TG_TOKEN=xxx
|
|
|
|
export RSSBOT_DSN=xxx
|
2022-07-10 14:40:19 +00:00
|
|
|
python update.py
|
2022-08-04 21:40:22 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Runnig the bot with Docker
|
|
|
|
|
|
|
|
```shell
|
|
|
|
docker build . -t tg_bot
|
|
|
|
docker run tg_bot
|
|
|
|
```
|
|
|
|
|
|
|
|
## Runnig the update with Docker
|
|
|
|
|
|
|
|
```shell
|
|
|
|
docker run tg_bot update.py
|
|
|
|
```
|
|
|
|
|
|
|
|
## Running the bot with docker-compose
|
|
|
|
|
|
|
|
```shell
|
|
|
|
docker-compose up
|
|
|
|
```
|
|
|
|
|
|
|
|
## Running the update with docker-compose
|
|
|
|
|
|
|
|
```shell
|
|
|
|
docker-compose run app update.py
|
2022-07-10 14:40:19 +00:00
|
|
|
```
|