https://github.com/passchn/konzertmeister
Konzertmeister Integration for PHP
https://github.com/passchn/konzertmeister
Last synced: 9 months ago
JSON representation
Konzertmeister Integration for PHP
- Host: GitHub
- URL: https://github.com/passchn/konzertmeister
- Owner: passchn
- Created: 2023-07-10T20:48:21.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-16T23:08:13.000Z (over 1 year ago)
- Last Synced: 2025-03-25T22:21:30.189Z (about 1 year ago)
- Language: PHP
- Size: 693 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Konzertmeister plugin for PHP
## Installation
Install the package via composer:
```sh
composer require passchn/konzertmeister
```
**Dependencies:**
* php ^8.1
* guzzlehttp/guzzle ^7
* nette/http ^3
## Usage
```php
// Copy the "Terminlisten-Link" with your filters (tags, types, ...) from this url:
// https://web.konzertmeister.app/export/list
// Note: Don't change the params as the hash will be invalid!
$url = 'https://rest.konzertmeister.app/api/v3/org/OALS_4dad../upcomingappointments?types=1,2&limit=5&display=light&tags=22351,2024&hash=93af9...'
$guzzle = new GuzzleHttp\Client();
$options = new Passchn\Konzertmeister\Network\ClientOptions($guzzle, $url);
$client = new Passchn\Konzertmeister\Network\Client($options);
/** @var list **/
$events = $client->fetch();
```
If everything worked, `$events` will be an array of `Passchn\Konzertmeister\Event\Event`.
```php
$event = current($events);
$eventName = $event->name;
$dateFrom = $event->start->format('d.m.Y');
echo "$eventName wird am $dateFrom stattfinden. Wir freuen uns auf Deinen Besuch!";
```
### Contribution
Feel free to open a ticket or a pull request.