This is a small script that checks the availability of open dates on the mfa.gov.ua website and sends an alarm through Telegram if a date is available.
- Python 3
- Selenium (for checking open dates)
- webdriver_manager (for managing the web driver)
- python-telegram-bot (for sending Telegram alerts)
- Create a virtual environment and activate it:
python3 -m venv /workspace/venv source /workspace/venv/bin/activate
- Install the key libraries:
pip install selenium pip install webdriver_manager pip install python-telegram-bot
- Create your Telegram bot using @BotFather. Make sure to obtain the bot token, which you'll need for your code.
- Modify the code to set the desired location and service to check for open dates. You can use driver.find_element(By.CSS_SELECTOR, "") to locate elements on the page.
- Adjust the frequency of script execution with asyncio.sleep().
- When running python main.py, connect to your bot and type "/start" in the chat. You should receive a message saying "Bot is running" and then type the next message to start the echo function.
- If the bot finds an open date, it will send you a message and a screenshot of the available date.