Files
infomate.club/Makefile
Vitalii Honchar 2eaa9fa65c Telegram -> RSS parser (#16)
* Created first dev version of Telegram channels parser

* Created endpoint for get Telegram Channel RSS

* Added *.session and venv/ in .gitignore

* Added dependency telethon

* Added script for init Telethon

* Removed unnecessary script parse.py

* Added possibility for dynamic generate RSS feeds from Telegram channel

* Deleted saving Telegram messages in database

* Minor refactor

Created separated files: parsers.py and utils.py

* Enhanced text parser: parse title and description if can

* Added attachment parsers: video, photo, voice and file parsers

* Added possibility for merge grouped messages into one item

* Renamed url for parse Telegram channel from "rss/telegram/<str:channel>" to "parsing/telegram/<str:channel>/"

* Format code with black

* Refactor: created package parsing.telegram and rename utils to models

* Added Makefile target telegram
2020-02-12 10:57:52 +01:00

63 lines
1.5 KiB
Makefile

# Set the default goal if no targets were specified on the command line
.DEFAULT_GOAL = run
# Makes shell non-interactive and exit on any error
.SHELLFLAGS = -ec
PROJECT_NAME=infomate
dev-requirements: ## Install dev requirements
@pip3 install -r requirements.txt
docker_run: ## Run dev server in docker
@python3 ./utils/wait_for_postgres.py
@python3 manage.py migrate
@python3 manage.py runserver
feed_cleanup: ## Cleanup RSS feeds
@python3 ./scripts/cleanup.py
feed_init: ## Initialize feeds from boards.yml
@python3 ./scripts/initialize.py --config boards.yml --no-upload-favicons -y
feed_refresh: ## Refresh RSS feeds
@python3 ./scripts/update.py
help: ## Display this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| sort \
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[0;32m%-30s\033[0m %s\n", $$1, $$2}'
lint: ## Lint code with flake8
flake8 $(PROJECT_NAME)
migrate: ## Migrate database to the latest version
@python3 manage.py migrate
mypy: ## Check types with mypy
mypy $(PROJECT_NAME)
run: ## Runs dev server
@python3 manage.py runserver
telegram:
@python3 setup_telegram.py
test-ci: test-requirements lint mypy ## Run tests (intended for CI usage)
test-requirements: ## Install requirements to run tests
@pip3 install -r ./requirements-test.txt
.PHONY: \
dev-requirements \
docker_run \
feed_cleanup \
feed_init \
feed_refresh \
help \
lint \
migrate \
mypy \
run \
test-ci \
test-requirements