Simple app for reposting posts from VK to Telegram. Can be easily deployed as AWS lambda function.
Since main deployment method is as lambda function, configuration is done with environment variables.
VK app service token. To get it you need to create a VK app and copy app service token from there.
Source ID of VK group.
Telegram bot token. Create a bot
Target Telegram chat or channel id.
Path to SQLite database file. Default is /tmp/database.db
DSN for sentry error reports
- Set up S3 bucket,
- Set these environment variables along with variables in Configuration section:
S3_BUCKET
,S3_KEY
,S3_ENDPOINT
,AWS_ACCESS_KEY_ID
,AWS_SECRET_ACCESS_KEY
, - Set entrypoint to
flow.main.lambda_handler
, - Clone this repo and upload zip archive generated by
bash scripts/prepare_artifact.sh
, - Configure timer trigger for the function.
- Clone and install the app. Note that you need to have poetry installed.
git clone --depth 1 https://github.com/vrslev/flow.git
cd flow
poetry install
- Configure .env file with the variables,
- Run:
poetry run python3 flow/main.py
- Install with pip:
pip install git+https://github.com/vrslev/flow.git
- Use
flow
wherever you want. For example:
from flow.main import main
from flow.models import Settings
settings = Settings()
main(settings)
Each call publishes only one post, doesn't matter if there's more available. This is done so you can easily customize publishing schedule (and use it in lambda ๐).