Image Signatures Group » Diskussionen

Fetching recently played track albums from last.fm

 
    • therobbot schrieb...
    • Benutzer
    • 1. Sep. 2006, 10:50

    Fetching recently played track albums from last.fm

    Hi,

    I just realized that the following is possible and am now using it when my Musicbrainz/Amazon query fails. Maybe it is helpful for anybody:

    $url is the track url that you can get from the recenttracks xml file:


    $html = file_get_contents($url);

    //find album in source
    preg_match('/.*div class="cover".*?title.*?- (.*?)".*?src="(.*?)"/isu', $html, $matches);

    // It is a jpg (no_cover-image is gif)
    if(stristr($matches[2], "jpg"))
    {
    $album=$matches[1];
    $albumURL=$matches[2];
    }



    Maybe this helps anyone until they finally put more infos in the XML.

    Tobias

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.