phplastfmapi artist.getevents

    • slope_mk2 schrieb...
    • Benutzer
    • 18. Jun. 2011, 14:53

    phplastfmapi artist.getevents

    Hi alltogether!

    I'm trying to use the phplastfmapi script for receiving any API data on my website. I have edited the example file for "artist.getevents" as posted below:

    error_reporting (E_ALL| E_STRICT);

    // Include the API
    require '../../lastfmapi/lastfmapi.php';

    $vars = array(
    'apiKey' => 'MY-API',
    'secret' => 'MY-SECRET',
    'username' => 'USERNAME_FROM_GETSESSION',
    'sessionKey' => 'SESSION_KEY_FROM_GETSESSION',
    'subscriber' => 'SUBSCRIBER_FROM_GETSESSION'
    $auth = new lastfmApiAuth('setsession', $vars);

    // Get the session auth data
    $file = fopen('./auth.txt', 'r');
    // Put the auth data into an array
    $authVars = array(
    'apiKey' => trim(fgets($file)),
    'secret' => trim(fgets($file)),
    'username' => trim(fgets($file)),
    'sessionKey' => trim(fgets($file)),
    'subscriber' => trim(fgets($file))
    $config = array(
    'enabled' => true,
    'path' => '../../lastfmapi/',
    'cache_length' => 1800
    // Pass the array to the auth class to eturn a valid auth
    $auth = new lastfmApiAuth('setsession', $authVars);

    // Call for the album package class with auth data
    $apiClass = new lastfmApi();
    $artistClass = $apiClass->getPackage($auth, 'artist', $config);

    // Setup the variables
    $methodVars = array(
    'artist' => 'Kylesa',
    if ( $events = $artistClass->getEvents($methodVars) ) {
    echo '<b>Data Returned</b>';
    echo '<pre>';
    echo '</pre>';
    else {
    die('<b>Error '.$artistClass->error['code'].' - </b><i>'.$artistClass->error['desc'].'</i>');


    When I run the script on my website i get these informations:

    array(1) { ["artist"]=> string(6) "Kylesa" }

    array(5) { ["apiKey"]=> string(39) "$auth->MY-API" ["secret"]=> string(39) "$auth->MY-SECRET" ["username"]=> string(16) "$auth->slope_mk2" ["sessionKey"]=> string(17) "$auth->sessionKey" ["subscriber"]=> string(17) "$auth->subscriber" } Error 90 - Artist has no events

    As I know that the Artist Kylesa is giving an event today that's in the lastfm-db, I don't know why anything is posted? As I change the artist to anything else I get the same Error 90...

    Any tips for me?

    <a href=""; target="_blank"></a>; (German speaking)
Anonyme Benutzer dürfen keine Beiträge schreiben. Bitte log dich ein oder registriere dich, um Beiträge in den Foren schreiben zu können.