Download the PHP package alienlebarge/lastfm-sync without Composer
On this page you can find all versions of the php package alienlebarge/lastfm-sync. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alienlebarge/lastfm-sync
More information about alienlebarge/lastfm-sync
Files in alienlebarge/lastfm-sync
Package lastfm-sync
Short Description Kirby plugin to synchronize loved tracks from Last.fm and automatically create jam pages
License MIT
Informations about the package lastfm-sync
Last.fm Sync Plugin
Kirby plugin to synchronize loved tracks from Last.fm and automatically create jam pages.
Installation
- Place the
lastfm-syncfolder insite/plugins/ - Configure options in
site/config/config.php
Configuration
Options
apiKey: Last.fm API keyuser: Last.fm usernamewebhookLimit: Number of tracks to retrieve (default: 20)webhookSecret: Security token for webhookcontentDir: Content directory (default: 'jams')
Usage
Webhook
Synchronization via POST webhook:
Or call the URL directly with GET parameter:
Page Methods
Site Methods
Response
Security
The webhook uses a secret token for authentication. Configure webhookSecret in your options.
It has no default. The endpoint answers 503 until a secret is set, rather than running unauthenticated — worth knowing if you fill the option from an environment variable, since a missing .env then fails closed instead of exposing the endpoint. The placeholder used in this README is refused for the same reason: it is published here.
Secrets are compared with hash_equals().
Monitoring a scheduled task
Every response carries a status field, and only a successful run contains OK:
Failures say FAILED rather than relying on the success flag, so a host that monitors a task by matching a string in the body cannot pass on an error. HTTP status codes are set in parallel: 403 on an invalid secret, 503 when no secret is configured, 500 on a failure during synchronization.
License
MIT