AmbaBot is a Python script designed to automate checking for available slots at the russian ambassy in Paris.
The main function of AmbaBot is to handle requests identified by the AMBASSY_REQUEST_NUMBER
.
The bot will:
- Connect to https://paris.kdmid.ru with your
AMBASSY_REQUEST_NUMBER
andAMBASSY_PROTECTION_CODE
- solve the captcha using aws textract
- extract the current status of your request
- if there are free slots, send an email to
EMAIL_TO
This project contains a Python AWS Lambda function and Terraform configuration for deploying it.
- AWS account
- Python 3.10
- Pipenv
- Terraform
- Install the Python dependencies:
pipenv install
- Run the Python script locally:
pipenv run ambabot
- Build the Lambda deployment package:
./build.sh
- Initialize Terraform:
terraform init
- Apply the Terraform configuration:
terraform apply
Create a .env
file in the project root with the following variables:
AWS_REGION=your_aws_region
AWS_PROFILE=your_aws_profile
# Номер заявки
AMBASSY_REQUEST_NUMBER=999999
# Защитный код
AMBASSY_PROTECTION_CODE=XXXXXXXX
LOG_LEVEL=DEBUG
EMAIL_TO=contact@ophir.dev
EMAIL_FROM=contact@ophir.dev
The logs are available in CloudWatch, in the log group /aws/lambda/ambabot
.
To view the logs, run the following command:
aws logs get-log-events --log-group-name /aws/lambda/ambabot --log-stream-name $(aws logs describe-log-streams --log-group-name /aws/lambda/ambabot --limit 1 --query 'logStreams[0].logStreamName' --output text)