/Tipping-Bot

A bot which can submit tips for a Kicktipp competition based on quotes.

Primary LanguagePythonMIT LicenseMIT

Kicktipp-Bot

This script can automatically enter tips into Kicktipp based on the quotes of the bookmakers. It is written in Python and uses Selenium to interact with the website.

Easy Install

Execute the commands below in the Terminal-Program:

# Install brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install Docker
brew install docker

# Get Image
docker pull antonengelhardt/kicktipp-bot:arm64
# or
docker pull antonengelhardt/kicktipp-bot:amd64

# Run Container and set your env variables
docker run \
-it \
--name kicktipp-bot \
-e KICKTIPP_EMAIL=<YOUR_EMAIL> \
-e KICKTIPP_PASSWORD=<YOUR_PASSWORD> \
-e KICKTIPP_NAME_OF_COMPETITION=<NAME_OF_COMPETITION> \
-e ZAPIER_URL<URL> \
antonengelhardt/kicktipp-bot:arm64
# or
antonengelhardt/kicktipp-bot:amd64

Zapier Integration

If you want to receive a notification when the script tips for a match, you can use the Zapier integration. Please create a Zapier Account and set up the following Trigger: Custom Webhook. Please also make sure you set the ENV Variable ZAPIER_URL to the URL of your custom webhook. Then you can set up actions like sending an email or a push notification.

Make commands

This project uses make to simplify the execution of commands. The following commands are available:

  • make all - run docker-build and docker-push
  • make local-run - Runs the script locally with GUI and without Zapier
  • make local-run-with-zapier - Runs the script locally with GUI and with Zapier
  • make docker-build - Builds the Docker image
  • make docker-run - Runs the Docker image
  • make docker-build-and-push - Builds and pushes the Docker image to Docker Hub
  • make docker-reset - Stops and removes the Docker container
  • make docker-all - Runs all Docker commands

Setup when running without Docker

  1. Clone the repository

  2. Install chromedriver (https://chromedriver.chromium.org/downloads)

    Please choose the version that corresponds to your Chrome version.

  3. Install the requirements

    pip3 install -r requirements.txt
  4. Set the constant CHROMEDRIVER_PATH to the path of the chromedriver executable.

    It is recommended to place the executable in the same directory as the script or into the Applications folder.

  5. Set the constants EMAIL, PASSWORD, NAME_OF_COMPETITON and ZAPIER_URL as environment variables to your Kicktipp credentials to the day on which the script should be executed.

    For zsh:

    echo 'export KICKTIPP_EMAIL=<KICKTIPP_EMAIL>' >> ~/.zshenv
    echo 'export KICKTIPP_PASSWORD=<KICKTIPP_PASSWORD>' >> ~/.zshenv
    echo 'export KICKTIPP_NAME_OF_COMPETITION=<NAME_OF_COMPETITION>' >> ~/.zshenv
    # ZAPIER_URL is optional
    echo 'export ZAPIER_URL=<ZAPIER_URL>' >> ~/.zshenv

    For bash:

    echo 'export KICKTIPP_EMAIL=<KICKTIPP_EMAIL>' >> ~/.bash_profile
    echo 'export KICKTIPP_PASSWORD=<KICKTIPP_PASSWORD>' >> ~/.bash_profile
    echo 'export KICKTIPP_NAME_OF_COMPETITION=<NAME_OF_COMPETITION>' >> ~/.bash_profile
    # ZAPIER_URL is optional
    echo 'export ZAPIER_URL=<ZAPIER_URL>' >> ~/.bash_profile

    You may also source the setup.sh-script:

    source setup.sh
  6. Execute the script

    python main.py local withZapier # with GUI and Zapier
    # or
    python main.py headless # without GUI and Zapier

Setup when running with Docker

  1. Clone the repository

  2. Install Docker (https://docs.docker.com/get-docker/)

  3. Pull the image from Docker Hub or build it yourself

    docker pull antonengelhardt/kicktipp-bot:arm64 # for Apple Silicon
    docker pull antonengelhardt/kicktipp-bot:amd64 # for Intel
    
    # or
    
    docker build -t antonengelhardt/kicktipp-bot:tag .
  4. Run the container in the foreground

    docker run \
    -it \
    --name kicktipp-bot \
    -e KICKTIPP_EMAIL=<YOUR_EMAIL> \
    -e KICKTIPP_PASSWORD=<YOUR_PASSWORD> \
    -e KICKTIPP_NAME_OF_COMPETITION=<NAME_OF_COMPETITION> \
    -e ZAPIER_URL<URL> \
    antonengelhardt/kicktipp-bot:tag
  5. Run the container in the background

    docker run \
    -d \
    --name kicktipp-bot \
    -e KICKTIPP_EMAIL=<YOUR_EMAIL> \
    -e KICKTIPP_PASSWORD=<YOUR_PASSWORD> \
    -e KICKTIPP_NAME_OF_COMPETITION=<NAME_OF_COMPETITION> \
    -e ZAPIER_URL<URL> \
    antonengelhardt/kicktipp-bot:tag

Check logs

docker logs kicktipp-bot

Stop container

docker stop kicktipp-bot

Start container

docker start kicktipp-bot

Remove container

docker rm kicktipp-bot