Zend Framework  1.12
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Zend_Service_Audioscrobbler Class Reference

Public Member Functions

 __construct ()
 Sets up character encoding, instantiates the HTTP client, and assigns the web service version.
 
 setHttpClient (Zend_Http_Client $client)
 Set Http Client.
 
 getHttpClient ()
 Get current http client.
 
 get ($field)
 Returns a field value, or false if the named field does not exist.
 
 set ($field, $value)
 Generic set action for a field in the parameters being used.
 
 userGetProfileInformation ()
 Utility function to get Audioscrobbler profile information (eg: Name, Gender)
 
 userGetTopArtists ()
 Utility function get this user's 50 most played artists.
 
 userGetTopAlbums ()
 Utility function to get this user's 50 most played albums.
 
 userGetTopTracks ()
 Utility function to get this user's 50 most played tracks.
 
 userGetTopTags ()
 Utility function to get this user's 50 most used tags.
 
 userGetTopTagsForArtist ()
 Utility function that returns the user's top tags used most used on a specific artist.
 
 userGetTopTagsForAlbum ()
 Utility function that returns this user's top tags for an album.
 
 userGetTopTagsForTrack ()
 Utility function that returns this user's top tags for a track.
 
 userGetFriends ()
 Utility function that retrieves this user's list of friends.
 
 userGetNeighbours ()
 Utility function that returns a list of people with similar listening preferences to this user.
 
 userGetRecentTracks ()
 Utility function that returns a list of the 10 most recent tracks played by this user.
 
 userGetRecentBannedTracks ()
 Utility function that returns a list of the 10 tracks most recently banned by this user.
 
 userGetRecentLovedTracks ()
 Utility function that returns a list of the 10 tracks most recently loved by this user.
 
 userGetWeeklyChartList ()
 Utility function that returns a list of dates of available weekly charts for a this user.
 
 userGetWeeklyAlbumChart ($from=NULL, $to=NULL)
 Utility function that returns weekly album chart data for this user.
 
 userGetWeeklyArtistChart ($from=NULL, $to=NULL)
 Utility function that returns weekly artist chart data for this user.
 
 userGetWeeklyTrackChart ($from=NULL, $to=NULL)
 Utility function that returns weekly track chart data for this user.
 
 artistGetRelatedArtists ()
 Utility function that returns a list of artists similiar to this artist.
 
 artistGetTopFans ()
 Utility function that returns a list of this artist's top listeners.
 
 artistGetTopTracks ()
 Utility function that returns a list of this artist's top-rated tracks.
 
 artistGetTopAlbums ()
 Utility function that returns a list of this artist's top-rated albums.
 
 artistGetTopTags ()
 Utility function that returns a list of this artist's top-rated tags.
 
 albumGetInfo ()
 Get information about an album.
 
 trackGetTopFans ()
 Get top fans of the current track.
 
 trackGetTopTags ()
 Get top tags of the current track.
 
 tagGetTopTags ()
 Get Top Tags.
 
 tagGetTopAlbums ()
 Get top albums by current tag.
 
 tagGetTopArtists ()
 Get top artists by current tag.
 
 tagGetTopTracks ()
 Get Top Tracks by currently set tag.
 
 groupGetWeeklyChartList ()
 Get weekly chart list by current set group.
 
 groupGetWeeklyArtistChartList ($from=NULL, $to=NULL)
 Retrieve weekly Artist Charts.
 
 groupGetWeeklyTrackChartList ($from=NULL, $to=NULL)
 Retrieve Weekly Track Charts.
 
 groupGetWeeklyAlbumChartList ($from=NULL, $to=NULL)
 Retrieve Weekly album charts.
 
 _errorHandler ($errno, $errstr, $errfile, $errline, array $errcontext)
 Saves the provided error information to this instance.
 
 __call ($method, $args)
 Call Intercept for set($name, $field)
 

Protected Member Functions

 lazyLoadHttpClient ()
 Lazy load Http Client if none is instantiated yet.
 
 _getInfo ($service, $params=null)
 Protected method that queries REST service and returns SimpleXML response set.
 

Protected Attributes

 $_client
 
 $_params
 
 $_error = null
 

Constructor & Destructor Documentation

__construct ( )

Sets up character encoding, instantiates the HTTP client, and assigns the web service version.

Member Function Documentation

__call (   $method,
  $args 
)

Call Intercept for set($name, $field)

Parameters
string$method
array$args
Returns
Zend_Service_Audioscrobbler
_errorHandler (   $errno,
  $errstr,
  $errfile,
  $errline,
array  $errcontext 
)

Saves the provided error information to this instance.

Parameters
integer$errno
string$errstr
string$errfile
integer$errline
array$errcontext
Returns
void
_getInfo (   $service,
  $params = null 
)
protected

Protected method that queries REST service and returns SimpleXML response set.

Parameters
string$servicename of Audioscrobbler service file we're accessing
string$paramsparameters that we send to the service if needded
Exceptions
Zend_Http_Client_Exception
Zend_Service_Exception
Returns
SimpleXMLElement result set protected
See Also
Zend_Http_Client_Exception
Zend_Http_Client_Exception
Zend_Http_Client_Exception
Zend_Service_Exception
albumGetInfo ( )

Get information about an album.

Returns
SimpleXMLElement
artistGetRelatedArtists ( )

Utility function that returns a list of artists similiar to this artist.

Returns
SimpleXMLElement object containing result set
artistGetTopAlbums ( )

Utility function that returns a list of this artist's top-rated albums.

Returns
SimpleXMLElement object containing result set
artistGetTopFans ( )

Utility function that returns a list of this artist's top listeners.

Returns
SimpleXMLElement object containing result set
artistGetTopTags ( )

Utility function that returns a list of this artist's top-rated tags.

Returns
SimpleXMLElement object containing result set
artistGetTopTracks ( )

Utility function that returns a list of this artist's top-rated tracks.

Returns
SimpleXMLElement object containing result set
get (   $field)

Returns a field value, or false if the named field does not exist.

Parameters
string$field
Returns
string|false
getHttpClient ( )

Get current http client.

Returns
Zend_Http_Client
groupGetWeeklyAlbumChartList (   $from = NULL,
  $to = NULL 
)

Retrieve Weekly album charts.

Parameters
int$from
int$to
Returns
SimpleXMLElement
groupGetWeeklyArtistChartList (   $from = NULL,
  $to = NULL 
)

Retrieve weekly Artist Charts.

Parameters
int$from
int$to
Returns
SimpleXMLElement
groupGetWeeklyChartList ( )

Get weekly chart list by current set group.

See Also
set()
Returns
SimpleXMLElement
groupGetWeeklyTrackChartList (   $from = NULL,
  $to = NULL 
)

Retrieve Weekly Track Charts.

Parameters
int$from
int$to
Returns
SimpleXMLElement
lazyLoadHttpClient ( )
protected

Lazy load Http Client if none is instantiated yet.

Returns
void
set (   $field,
  $value 
)

Generic set action for a field in the parameters being used.

Parameters
string$fieldname of field to set
string$valuevalue to assign to the named field
Returns
Zend_Service_Audioscrobbler Provides a fluent interface
setHttpClient ( Zend_Http_Client  $client)

Set Http Client.

Parameters
Zend_Http_Client$client
tagGetTopAlbums ( )

Get top albums by current tag.

Returns
SimpleXMLElement
tagGetTopArtists ( )

Get top artists by current tag.

Returns
SimpleXMLElement
tagGetTopTags ( )

Get Top Tags.

Returns
SimpleXMLElement
tagGetTopTracks ( )

Get Top Tracks by currently set tag.

Returns
SimpleXMLElement
trackGetTopFans ( )

Get top fans of the current track.

Returns
SimpleXMLElement
trackGetTopTags ( )

Get top tags of the current track.

Returns
SimpleXMLElement
userGetFriends ( )

Utility function that retrieves this user's list of friends.

Returns
SimpleXMLElement object containing result set
userGetNeighbours ( )

Utility function that returns a list of people with similar listening preferences to this user.

Returns
SimpleXMLElement object containing result set
userGetProfileInformation ( )

Utility function to get Audioscrobbler profile information (eg: Name, Gender)

Returns
array containing information
userGetRecentBannedTracks ( )

Utility function that returns a list of the 10 tracks most recently banned by this user.

Returns
SimpleXMLElement object containing result set
userGetRecentLovedTracks ( )

Utility function that returns a list of the 10 tracks most recently loved by this user.

Returns
SimpleXMLElement object containing result set
userGetRecentTracks ( )

Utility function that returns a list of the 10 most recent tracks played by this user.

Returns
SimpleXMLElement object containing result set
userGetTopAlbums ( )

Utility function to get this user's 50 most played albums.

Returns
SimpleXMLElement object containing result set
userGetTopArtists ( )

Utility function get this user's 50 most played artists.

Returns
array containing info
userGetTopTags ( )

Utility function to get this user's 50 most used tags.

Returns
SimpleXMLElement object containing result set
userGetTopTagsForAlbum ( )

Utility function that returns this user's top tags for an album.

Returns
SimpleXMLElement object containing result set
userGetTopTagsForArtist ( )

Utility function that returns the user's top tags used most used on a specific artist.

Returns
SimpleXMLElement object containing result set
userGetTopTagsForTrack ( )

Utility function that returns this user's top tags for a track.

Returns
SimpleXMLElement object containing result set
userGetTopTracks ( )

Utility function to get this user's 50 most played tracks.

Returns
SimpleXML object containing resut set
userGetWeeklyAlbumChart (   $from = NULL,
  $to = NULL 
)

Utility function that returns weekly album chart data for this user.

Parameters
integer$fromoptional UNIX timestamp for start of date range
integer$tooptional UNIX timestamp for end of date range
Returns
SimpleXMLElement object containing result set
userGetWeeklyArtistChart (   $from = NULL,
  $to = NULL 
)

Utility function that returns weekly artist chart data for this user.

Parameters
integer$fromoptional UNIX timestamp for start of date range
integer$tooptional UNIX timestamp for end of date range
Returns
SimpleXMLElement object containing result set
userGetWeeklyChartList ( )

Utility function that returns a list of dates of available weekly charts for a this user.

Should actually be named userGetWeeklyChartDateList() but we have to follow audioscrobbler's naming

Returns
SimpleXMLElement object containing result set
userGetWeeklyTrackChart (   $from = NULL,
  $to = NULL 
)

Utility function that returns weekly track chart data for this user.

Parameters
integer$fromoptional UNIX timestamp for start of date range
integer$tooptional UNIX timestamp for end of date range
Returns
SimpleXMLElement object containing result set

Member Data Documentation

$_client
protected
$_error = null
protected
$_params
protected