Giter Club home page Giter Club logo

munich-scripts's Introduction

General

Some useful scripts simplifying bureaucracy, especially when living in Munich, Germany.

termin_api.py

Small tool to show availability of appointments in different Departments of Munich.

Available departments are:

Please note the script does not perform appointment booking (see #4), it just tells you current status and allows you to subscribe to a notifier for one week.

Telegram bot

There is a Telegram bot at @MunichTerminBot using termin_api.py functionality. The bot is written using python-telegram-bot library. Source code is also in this repo, tg_bot.py.

Development

By default bot runs as webhook configured for personal web server. For local development it's easier to use polling. In order to get it, just set DEBUG = True in one of first lines of the script.

Bot deployment

Bot is hosted on personal web server, running in Docker and automatic deploy from master branch of this repo is set, no action should be required.

Manual deployment

Pre-requisites:

  • TG_TOKEN environment variable is set in .env file

If you want to enable Elastic statistics, then additionally set following variables to non-empty value:

  • ELASTIC_HOST - hostname where ELK stack is deployed
  • ELASTIC_USER - ElasticSearch username
  • ELASTIC_PASS - ElasticSearch password

Commands for manual deploy

git pull
docker-compose build
docker-compose up -d

Shortly after deploy make sure everything is running

docker-compose logs -f

Script usage

Edit script content and select what type of appointments you actually need:

appointments = get_termins(DMV, 'FS Umschreibung Ausländischer FS')
# appointments = get_termins(CityHall, 'An- oder Ummeldung - Einzelperson')
# appointments = get_termins(ForeignLabor, 'Niederlassungserlaubnis Blaue Karte EU')

Run the script

python3 termin_api.py

Output will be printed in the console

munich-scripts's People

Contributors

aestuans avatar agusherrera avatar armonge avatar bomme avatar dependabot-preview[bot] avatar dependabot[bot] avatar guipsamora avatar joistick11 avatar matrixtux avatar okainov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

munich-scripts's Issues

Save subscription data between deploys

Is is possible to do with bare Heroku? I can migrate the bot to my VPS and implement a proper database for subscriptions, but if there is a way to KISS, would b egreat

Bot fails to fetch types of appointments for Führerscheinstelle

Yesterday and today I tried to set an alert for Führerscheinstelle appointments. But the bot freezes on “Fetching available appointment types...”.

Yesterday, it just printed this once and froze. Today, it keeps repeating this message over and over with no result.

For other offices it works fine for me.

Uploading E2A94743-8134-45E1-9676-4326917F5258.png…

Errors in bot

Seems like appointment title is not accepted by the buro <Ausländerbehörde> any more
Please create issue on Github (https://github.com/okainov/munich-scripts/issues/new)

Current subscription details:

  • Department: Ausländerbehörde
  • Type: Aufenthaltserlaubnis Blaue Karte EU
  • Interval: 0:05:00
  • Until: 08-03-2020 15:25:05

Bot Freezes at the Fetching state

Hi, thank you very much the work you've done!

I wanted to report some issues with @MunichTerminBot.
I tried to set an alert for Führerscheinstelle appointments. However, the bot freezes on “Fetching available appointment types...”. And it's the same with all the other departments.

I have tried to run a script from terminal_api.py and it worked well.

Create telegram bot for notifications

Would be cool =) Someone already did it, but hasn't published the sources :(

As I understood, bot can be hosted somewhere like pythonanywhere without any issues

KVR Appointment Dates - Ruppert Str. Missing

Hello,
I tried your telegram bot and it works very good. The only thing is that I'm missing the appointment dates for the KVR Headquarter in Ruppert Str.
I checked the website and there are dates available but your bot does not list them.
Can you check that?

Add search caching

When amount of users is greater than couple, most probably there will be some overlaps in termin types. Instead of spamming Munich servers it would be better to have some kind of cache / periodic background checker and share results across users

Outdated Appointment categories

I was thrilled when I found "Familiennachzug(SCIF)" category for appointments however it turns out to be there is no such category. In fact there aren't many categories available as I think the office (Büro) has updated it's page. Please do fix this issue as this might give a false hope for the people who are trying for a longtime.

Add support for other documents

Except of driver license, there are online termins in other gov. places using very similar termin system:

Department of motor vehicles (Fuhrerscheinstelle) https://www.muenchen.de/rathaus/terminvereinbarung_fs.html <- The one currently supported
Burger buro (i.e. Anmeldung) main page https://www.muenchen.de/rathaus/terminvereinbarung_bb.html and frame https://www56.muenchen.de/termin/index.php?loc=BB
NE with Blue Card http://www.muenchen.de/dienstleistungsfinder/muenchen/1080805/ - potentially covered in https://github.com/aqeelarshad19/munich-scripts, @aqeelarshad19 would you like to collaborate here?
Maybe some others

Error in service title: Aufenthaltserlaubnis Blaue Karte EU

I created a subscription with details:

  • Department: Ausländerbehörde
  • Type: Aufenthaltserlaubnis Blaue Karte EU
  • Interval: 0:10:00
  • Until: 19-02-2020 19:56:16

Got an error:
Seems like appointment title is not accepted by the buro <Ausländerbehörde> any more

Blaue carte appointment error (captcha on web form)

Appointments check for Aufenthaltserlaubnis Blaue Karte EU returns an error.
When checking the website manually I see they implemented captcha on it. Is there any chance to go on with the bot regarding this change?

Add possibility to subscribe within a date range

Might be useful to add a new function as a subscription for available appointments for a certain date frame in the future.
For users who already know, they have to do something within a certain timeframe but there are no appointments at that stage

Add subscription

Would be nice to be able to subscribe for some termin so TG bot could notify you when any termins are available

Host bot on free public service

It would be nice to host the Telegram bot somewhere like PythonAnywhere/Heroku instead of private server.

Notes:

  • There should be adequate support for automatic redeploying (regular pulling from Github) the bot
  • Need to check availability of Munich appointment servers access from the host (i.e. PythonAnywhere has whitelist of external recources which are allowed to connect from the service)

Add "Most used termins"

Instead of throwing 20-30 random german words to poor users it would be nice to have some pre-defined set of most used appointments (~5 of them) such as

  • Getting Blue Card
  • Exchanging non-EU Driver license
  • Anmeldung

Add possibility to subscribe with date restriction

I see the main use case as following:

  • I already made some appointment booking for 2+ months in the future
  • So in general, there are available appointments, but not really soon
  • As a bot user, I want to find some appointment which is earlier (i.e. for tomorrow).

So it would be nice to have possibility to restrict date like "send me notifications only if available termin is before than 01-01-2020"

No option on booking site

In bot I see option 'Aufenhaltserlaubnis zur Beschaftigung (Fachkarte / Mengelberufe)', but no option on booking site

Revive bot

Bot was hosted in RU, now seems TG got finally blocked :(

Ausländerbehörde problem

I am trying to get Termine Ausländerbehörde for Residence permit to study.

The telegram part sticks after "Fetching available appointment types..." as you can see the picture
https://drive.google.com/file/d/199clrziXmMr4HKZ4JFWy6VWVW0cfevyW/view

And I don't know whether "appointments = get_termins(ForeignLabor, 'Niederlassungserlaubnis allgemein')" line in the termin_api.py works or not. Because I always get "ERROR: cannot find termins data in server's response. See log.txt for raw text" message, I put an inifinity loop in main function, but I don't get any appointment messages for 2 days.

All buros have added captcha?

Looks like now there is captcha not only for ABH, but for other buros as well (tried with Burgerburo)... Last week it was fine, so it seems they've just added it...

Anyone knows any free captcha-solving services? Otherwise, I suppose, there is not much help from the scripts/bot any more...

Add donate command

I'd like to donate some money for the bot development. Helped me a lot. Why don't you add a /donate command with a payment opportunity?

Implement localization possibility

It would be nice to have language selector, at least EN-DE-RU.

Mostly interested for Telegram bot, however even for the script itself it would be useful

Translatable items, at least:

  • Names of the buro
  • Names of CASETYPES

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.