Code Monkey home page Code Monkey logo

berlin-buergeramt-bot's Introduction

Berlin Bürgeramt Appointment Bot

A bot that sends a notification when a buergeramt appointment is available. It periodically checks the given buergeramt appointment page for new appointments. It then notifies the user using Telgram. As of now, this bot is meant to be self hosted - it can easily be run on a raspberry pi or a cheap vps.

Please use responsibly: Set a USER_AGENT containing contact information in case something goes wrong.

USE AT OWN RISK

Limitations

Currently this bot is only checking the current and the next month, as I was mainly going for appointments on short notice.

Getting started

  • clone the repository
git clone https://github.com/similicious/berlin-buergeramt-bot
  • cd into the cloned repository
  • install dependencies
npm install
  • create .env by copying .env.sample
cp .env.sample .env
  • edit .env to suit your needs
BOOKING_URL=The link to the appointments page. Use the link behind "Termin buchen" or "Termin berlinweit suchen" buttons.
USER_AGENT=A string containing your email address
CHECK_INTERVAL_MINUTES=The interval in minutes to check
TELEGRAM_BOT_TOKEN=
TELEGRAM_CHAT_ID=
HEALTHCHECKS_IO_TOKEN=Optional healthchecks.io token to monitor the bot
  • start src/index.js
node src/index.js

Optionally, you can use a node process manager like pm2 to monitor the app and automatically start the bot on boot.

Docker

The bot can also be run using docker. As of now, no image is provided. To build one yourself execute

docker build . -t similicious/berlin-buergeramt-bot

Next, create an .env as outlined above and run the container

docker run -d --env-file .env --name berlin-buergeramt-bot --restart unless-stopped similicious/berlin-buergeramt-bot

Obtaining a bot token and chat id

It's easiest to use the web / desktop client of Telegram for initial setup. More info on bots here.

  • Register a new bot using the Telegram bot BotFather.
  • Send the bot a message
  • Open https://api.telegram.org/bot<<BOT_TOKEN>>/getUpdates in a browser and extract the chatId from result[0].message.chat.id. You might need to refresh to see the message.

Run tests

I included some snapshots of appointment pages in various states. Execute test with

npm run test

berlin-buergeramt-bot's People

Contributors

similicious avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.