{"id":14529653,"url":"https://github.com/inverse/termin","last_synced_at":"2025-03-15T14:30:29.649Z","repository":{"id":43155105,"uuid":"150996986","full_name":"inverse/termin","owner":"inverse","description":"Simple PHP script for notifying for a free appointments on the Berlin services website.","archived":false,"fork":false,"pushed_at":"2025-02-24T19:27:03.000Z","size":392,"stargazers_count":57,"open_issues_count":7,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-27T02:42:31.827Z","etag":null,"topics":["abmeldung","berlin","php","scraper","telegram"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/inverse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-30T19:01:00.000Z","updated_at":"2025-01-20T23:02:44.000Z","dependencies_parsed_at":"2024-04-21T08:47:26.179Z","dependency_job_id":"b04d53a6-a90c-49a3-9e1b-633928097c74","html_url":"https://github.com/inverse/termin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inverse%2Ftermin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inverse%2Ftermin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inverse%2Ftermin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inverse%2Ftermin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inverse","download_url":"https://codeload.github.com/inverse/termin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243742503,"owners_count":20340659,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["abmeldung","berlin","php","scraper","telegram"],"created_at":"2024-09-05T00:01:01.459Z","updated_at":"2025-03-15T14:30:29.643Z","avatar_url":"https://github.com/inverse.png","language":"HTML","funding_links":[],"categories":["automated Bots"],"sub_categories":["Public Services"],"readme":"# Termin\n\nA simple PHP script for notifying for a free slot for any appointment listed on the [Berlin services website][0].\n\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/764fcbdbe9dd4383ad808cb4f83159af)](https://app.codacy.com/gh/inverse/termin?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=inverse/termin\u0026utm_campaign=Badge_Grade_Settings)\n[![Actions Status](https://github.com/inverse/termin/workflows/CI/badge.svg)](https://github.com/inverse/termin/actions)\n[![codecov](https://codecov.io/gh/inverse/termin/branch/master/graph/badge.svg)](https://codecov.io/gh/inverse/termin)\n\n\n![](https://i.imgur.com/8vxmVo2.png)\n\n# Notifications\n\nSupports notifications via:\n\n- [Pushbullet][1]\n- [Telegram][2]\n- [ntfy][6]\n\n# Requirements\n\n- PHP 8.1+\n- composer\n\n# Setup\n\nClone the repo\n\n```bash\ngit clone https://github.com/inverse/termin.git\n```\n\n## Dependencies\n\nInstall dependencies\n\n ```bash\n composer install\n```\n\n## Configuration\n\nConfigure an `config.yml` file based on the `example.config.yml` file located in the root of the repository.\n\n### Notifications\n\nTermin supports various notifiers, it will send notifications to each one you configure.\n\n#### ntfy (Easiest)\n\nSet `ntfy.topic` within `config.yml` to something unique to you.\n\n_You can customise the server if you wish to use a 3rd party or self-hosted one._\n\nConfigure your client to listen to the same configured server/topic.\n\n- From your [phone][7]\n- From your [browser][8]\n\n#### Pushbullet\n\nSet `pushbullet.api_token` within `config.yml` with an API token from your account. Follow their [quick start guide][3] on how to get this.\n\nMake sure you install their application or browser extension.\n\n#### Telegram\n\nFollow the [official documentation][4] on setting up a bot.\n\nWithin `config.yml` Set `telegram.api_key` with the API key provided from this process.\n\nYou will first need to make communication with the bot to enable it to send messages to you.\n\nOnce you have done that find your chat ID. You can get this by interacting with `@raw_data_bot` bot.\n\nSet the value in `telegram.chat_id`.\n\n##### Groups\n\nIf you are adding the bot to a group you must add your bot to your group.\n\nThen find the chat ID for the group by adding `@raw_data_bot` and it will detail this.\n\nTake care when copying the leading `-` as this is required for group chat IDs.\n\n### Site configuration\n\nYou can configure Termin to notify on multiple appointment types.\n\n```yaml\nsites:\n  -\n    label: Vaterschaftsanerkennung\n    type: berlin_service\n    params:\n      url: https://service.berlin.de/terminvereinbarung/termin/tag.php?termin=1\u0026dienstleister=122900\u0026anliegen[]=318991\u0026herkunft=1\n  -\n    label: Geburtsurkunde\n    type: berlin_service\n    params:\n      url: https://service.berlin.de/terminvereinbarung/termin/tag.php?termin=1\u0026dienstleister=122900\u0026anliegen[]=318957\u0026herkunft=1\n```\n\n- `label` - the friendly label that will be displayed in the notification\n- `type` - The type of scraper to use (`berlin_service` currently supported)\n- `params.url` - the service URL you want to book. e.g. the URL behind the \"Book an Appointment button\"\n\n![](https://i.imgur.com/zqSScD5.png)\n\n### Rules\n\nTermin also has a simple rule engine that can be used for only notifying when certain conditions are met. Below listed are the currently supported rules that can be used to control the triggering of notifications.\n\n#### after\n\nOnly notify when found appointments happen after condition.\n\n```yaml\nrules:\n  -\n    type: after\n    param: PT24H # Notify when the appointment is greater than 24h in the future\n```\n\nUses the PHP [DateInterval][5] construct.\n\n#### before\n\nOnly notify when found appointments happen before condition.\n\n```yaml\nrules:\n  -\n    type: before\n    param: PT24H # Notify when the appointment is less than 24h in the future\n```\n\nUses the PHP [DateInterval][5] construct.\n\n#### after_date\n\nOnly notify when found appointments happen after date condition.\n\n```yaml\nrules:\n  -\n    type: after_date\n    param: '2022-01-01 00:00:00'\n```\n\n#### before_date\n\nOnly notify when found appointments happen before date condition.\n\n```yaml\nrules:\n  -\n    type: before_date\n    param: '2022-01-01 00:00:00'\n```\n\n## Run\n\nYou can execute the script manually to test if everything is working correctly.\n\n```bash\nphp app.php\n```\n\nIf you see no errors and output similar to:\n\n```\n[2021-11-01T19:43:14.687782+00:00] termin.INFO: No availability found for: Anmeldung einer Wohnung [] []\n```\n\nYou can then configure this to run on a regular schedule using something that your OS provides.\n\nFor example with cron, setup a job to call `app.php` on desired run interval e.g. every hour\n\n ```bash\n0 * * * *  php ~/path/to/termin/app.php\n```\n\n_Note: Don't set the frequency to high to not overload their website_\n\nWait for a notification!\n\n## Run (docker)\n\nConfigure the application following the above steps and then run the prebuilt docker image.\n\n```bash\ndocker run -it -v $(pwd)/config.yml:/app/config.yml ghcr.io/inverse/termin/termin:latest\n```\n\nConfigure this to run on a regular schedule using something that your OS provides.\n\n_Note: Don't set the schedule frequency to high to not overload their website_\n\n## Run (serverless)\n\nTermin can also be run as a serverless application. Configure the application like you would like any other way.\n\nInstall serverless toolchain:\n\n```bash\nnpm install\n```\n\nThen configure your environment with [serverless tooling][9].\n\n\nAnd finally deploy:\n\n```bash\nnpx serverless deploy\n```\n\nTo remove run:\n\n```bash\nnpx serverless remove\n```\n\n\n# License\n\nMIT\n\n[0]: https://service.berlin.de/terminvereinbarung/\n[1]: https://www.pushbullet.com/\n[2]: https://telegram.org/\n[3]: https://docs.pushbullet.com/#api-quick-start\n[4]: https://core.telegram.org/bots#3-how-do-i-create-a-bot\n[5]: https://www.php.net/manual/en/dateinterval.construct.php\n[6]: https://ntfy.sh/\n[7]: https://ntfy.sh/docs/subscribe/phone/\n[8]: https://ntfy.sh/docs/subscribe/web/\n[9]: https://bref.sh/docs/setup\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finverse%2Ftermin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finverse%2Ftermin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finverse%2Ftermin/lists"}