NAME

WebService::Audioscrobbler::User - An object-oriented interface to the Audioscrobbler WebService API

SYNOPSIS

This module implements an object oriented abstraction of an user within the Audioscrobbler database.

use WebService::Audioscrobbler;

my $ws = WebService::Audioscrobbler->new;

# get an object for user named 'foo'
my $user  = $ws->user('foo');

# get user's top artists
my @artists = $user->artists;

# get user's top tags
my @tags = $user->tags;

# get user's top tracks
my @tracks = $user->tracks;

# get user's neighbours
my @neighbours = $user->neighbours; 

This module inherits from WebService::Audioscrobbler::Base.

FIELDS

name

The name of a given user as provided when constructing the object.

picture_url

URI object pointing to the location of the users's picture, if available.

url

URI object pointing to the location where's additional info might be available about the user.

METHODS

new($user_name)

new(\%fields)

Creates a new object using either the given $user_name or the \%fields hashref. Usually only used internally, since <WebService::Audioscrobbler-user($user_name)>> is provided as an external interface.

artists

Retrieves the user's top artists as available on Audioscrobbler's database.

Returns either a list of artists or a reference to an array of artists when called in list context or scalar context, respectively. The artists are returned as WebService::Audioscrobbler::Artist objects by default.

tracks

Retrieves the user's top tracks as available on Audioscrobbler's database.

Returns either a list of tracks or a reference to an array of tracks when called in list context or scalar context, respectively. The tracks are returned as WebService::Audioscrobbler::Track objects by default.

tags

Retrieves the user's top tags as available on Audioscrobbler's database.

Returns either a list of tags or a reference to an array of tags when called in list context or scalar context, respectively. The tags are returned as WebService::Audioscrobbler::Tag objects by default.

neighbours([$filter])

Retrieves musical neighbours from the Audioscrobbler database. $filter can be used as a constraint for neighbours with a low similarity index (ie. users which have a similarity index lower than $filter won't be returned).

Returns either a list of users or a reference to an array of users when called in list context or scalar context, respectively. The users are returned as WebService::Audioscrobbler::SimilarUser objects by default.

resource_url

Returns the URL from which other URLs used for fetching user info will be derived from.

AUTHOR

Nilson Santos Figueiredo Junior, <nilsonsfj at cpan.org>

COPYRIGHT & LICENSE

Copyright 2006 Nilson Santos Figueiredo Junior, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.