AndreBaumeier / impf-bot

πŸ’‰πŸ€– Bot for the German "ImpfterminService - 116117"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ’‰πŸ€– Impf-Bot

Kotlin Java Gradle Selenium

Searches the official "ImpfterminService - Der Patientenservice 116117" for free Corona vaccination slots. It can search multiple locations at once which can be provided in a list. When it finds a free slot, it can use Slack to send you a message. All timings can be configured for your needs and to avoid blocking.

πŸ“± Also the SMS verification step is managed by a Slack bot. Simply write the verification code into the Slack channel:

sms:999-999

⭐ Features

 β­ Full browser automation
 β­ No API Hacks
 β­ Telegram integration
 β­ Slack integration
 β­ Waiting room detection
 β­ Customizable by property file
 β­ Docker support to run it locally or in the cloud

Sequence Digramm These steps are repeated for every location. So it's no problem to check 14 locations at once. If the bot recognizes that no free slots are available, it waits 30 seconds and goes on to the next location.

⚠ Warning: The online booking isn't an authorization

On the booking date you still have to bring the documents with you, to proof that you are qualified to receive the vaccination. Check out the official guidelines and make sure you are qualified for them. This bot doesn't help you get a privilege. It only allows you to get a date without losing the nerves or waisting a lifetime in pointless callcenter calls.

What is Slack and do I need it?

This bot can also work without it. Slack is a messaging application for companies. It is useful to get realtime updates from the bot and to do the SMS verification without the need to be in front of your computer. Otherwise, when the verification starts, you have only 10 minutes left to type the code into the automated browser window. If you take a journey through the dangerous outside world, this may be unpractical. I have chosen Slack, because it proves a nice Java API and it was already running in our company.

πŸ›  Setup

Java

To build and run the bot you need at least a Java 14 installation.

Selenium

The Impf-Bot uses Selenium to automate a webbrowser. Selenium requires a locally installed driver and browser - Chrome is recommended. You can manually download the latest selenium drivers on GitHub - ChromeDriver or use this Windows bash script to do it for you:

@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
choco install selenium-chrome-driver

config.properties

Settings are stored in a config file which is located in: src/main/resources/config.properties.
Edit these settings before the first run. A missing boolean property will be treated as false.

mainPageUrl = https://www.impfterminservice.de/impftermine
# Comma separated list of locations. 
# Optional, if you already have a placement code, just add it in square brackets after the place 
locations = 69124 Heidelberg[XXXX-XXXX-XXXX],76137 Karlsruhe

# Waiting time before checking the next location in seconds [s]
waitingTime = 120
# Waiting time for a manual user interaction in minutes [m]
waitingTimeForUserAction = 15
# Waiting time in Waiting Room in minutes [m]
waitingTimeInWaitingRoom = 15
# Timeout when searching an element on the page in seconds [s]
searchElementTimeout = 16
# Explicit waiting time for browser updates in seconds [s]
waitingTimeForBrowser = 2

# Your age. Used in age verification field.
personAge = 42

# Settings for the request page. Only needed if you set `sendRequest = true`  
sendRequest = true
email = impfMePlease@lasthope.de
# Mobile number for sms verification. Numbers after the "+49"
mobileNumber = 152123123123

# Chrome Driver
pathDriver = C:/ProgramData/chocolatey/lib/chromedriver/tools/
nameDriver = webdriver.chrome.driver
exeDriver = chromedriver.exe

# Enabled the slack messages
slackEnabled = false
# These can be skipped, if Slack is `slackEnabled = false`
slackBotApiToken = xoxb-123123123-123123123123123123123123123
slackBotChannel = #random
# Also read the SMS back from a channel. Needs the slackBotChannelReadSms-Name and Id.
readSmsFromSlack = false
slackBotChannelReadSmsName = #smsgameway
slackBotChannelReadSmsId = CE99999PY

Setup Slack

This step is optional. You can find detailed setup instructions here: SlackBot Setup.

Setup Telegram

This step is optional. You can find detailed setup instructions here: TelegramBot Setup.

Docker

This step is optional. To run this tool in Docker, follow this tutorial: Docker.

simplelogger.properties

Per default the bot logs only successful bookings.
To change the Log-Level edit the defaultLogLevel:
org.slf4j.simpleLogger.defaultLogLevel = info
| β„Ή Change the log level to debug to get a more detailed output during every step.

πŸ”¨ Build

gradle build

The build creates runnable Java-fat-jar which contains all dependencies and the config:
build/libs/impf-bot-1.0-SNAPSHOT-all.jar

πŸš€ Start

To run the bot, simply use the gradle command:

gradle run

As an alternative, you can also start it with the fat-jar in the command line by:

java -jar build/libs/impf-bot-1.0-SNAPSHOT-all.jar 

About

πŸ’‰πŸ€– Bot for the German "ImpfterminService - 116117"


Languages

Language:Kotlin 92.0%Language:Dockerfile 8.0%