PHP code example of alienlebarge / lastfm-sync

1. Go to this page and download the library: Download alienlebarge/lastfm-sync library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

alienlebarge / lastfm-sync example snippets


return [
    'alienlebarge.lastfm-sync' => [
        'apiKey' => 'your-lastfm-api-key',
        'user' => 'your-lastfm-username',
        'webhookLimit' => 20,
        'webhookSecret' => 'your-webhook-secret',
        'contentDir' => 'jams'
    ]
];

// In a template or controller
$result = $page->syncJams(50); // Sync max 50 tracks

// Access to service
$syncService = site()->lastfmSync();
$result = $syncService->sync(20);