Last FM

Работа с Last FM.

Пример

$lastfm = Service::LastFM();

print_r($lastfm->user_profile('RJ'));

/* SimpleXMLElement Object
(
    [@attributes] => Array
        (
            [id] => 1000002
            [cluster] => 2
            [username] => RJ
        )

    [url] => http://www.last.fm/user/RJ
    [realname] => Richard Jones
    [mbox_sha1sum] => 0bf0949e67cffa83c66fd806e817dda3083c4d8b
    [registered] => Nov 20, 2002
    [age] => 27
    [gender] => m
    [country] => United Kingdom
    [playcount] => 54552
    [avatar] => http://userserve-ak.last.fm/serve/126/8270359.jpg
    [icon] => http://cdn.last.fm/depth/global/icon_staff.gif
) */

if (!$lastfm->error)
    // Пока без ошибок
    print_r('Пока без ошибок');

print_r($lastfm->user_artistTags('RJ', array('artist' => 'Metallica')));

/* SimpleXMLElement Object
(
    [@attributes] => Array
        (
            [user] => RJ
            [artist] => Metallica
        )

    [tag] => Array
        (
            [0] => SimpleXMLElement Object
                (
                    [name] => 80s
                    [count] => 488592
                    [url] => http://www.last.fm/tag/80s
                )

            // ...

        )

) */

print_r($lastfm->album_info('Metallica', 'Ride the Lightning'));

/* SimpleXMLElement Object
(
    [@attributes] => Array
        (
            [artist] => Metallica
            [title] => Ride The Lightning
        )

    [reach] => 373975
    [url] => http://www.last.fm/music/Metallica/Ride+The+Lightning
    [releasedate] =>     21 Dec 2009, 00:00
    [coverart] => SimpleXMLElement Object
        (
            [small] => http://userserve-ak.last.fm/serve/34s/8622973.jpg
            [medium] => http://userserve-ak.last.fm/serve/64s/8622973.jpg
            [large] => http://userserve-ak.last.fm/serve/126/8622973.jpg
        )

    [mbid] => 456efd39-f0dc-4b4d-87c7-82bbc562d8f3
    [tracks] => SimpleXMLElement Object
        (
            [track] => Array
                (
                    [0] => SimpleXMLElement Object
                        (
                            [@attributes] => Array
                                (
                                    [title] => Fight Fire With Fire
                                )

                            [reach] => 169586
                            [url] => http://www.last.fm/music/Metallica/_/Fight+Fire+With+Fire
                        )

                        // ...
                )

        )

) */

И всяко разно.