PHP Class Phergie_Plugin_AudioScrobbler, phergie

TODO: Make the "nick-binding" use an SQLite database instead of having them hard-coded in to the config file. Configuration settings: "audioscrobbler.lastfm_api_key": API given by last.fm (string). "audioscrobbler.librefm_api_key": API key given by libre.fm (string).
Inheritance: extends Phergie_Plugin_Abstract
Mostrar archivo Open project: phergie/phergie

Protected Properties

Property Type Description
$http Phergie_Plugin_Http HTTP plugin
$lastfmUrl string Last.FM API entry point
$librefmUrl string Libre.FM API entry point
$query string Scrobbler query string for user.getRecentTracks

Public Methods

Method Description
getScrobbled ( string $user, string $url, string $key ) : string Simple Scrobbler API function to get a formatted string of the most recent track played by a user.
onCommandLastfm ( string $user = null ) : void Command function to get a user's status on last.fm.
onCommandLibrefm ( string $user = null ) : void Command function to get a user's status on libre.fm.
onLoad ( ) : void Check for dependencies.

Method Details

getScrobbled() public method

Simple Scrobbler API function to get a formatted string of the most recent track played by a user.
public getScrobbled ( string $user, string $url, string $key ) : string
$user string Username to look up
$url string Base URL of the scrobbler service
$key string Scrobbler service API key
return string Formatted string of the most recent track played

onCommandLastfm() public method

Command function to get a user's status on last.fm.
public onCommandLastfm ( string $user = null ) : void
$user string User identifier
return void

onCommandLibrefm() public method

Command function to get a user's status on libre.fm.
public onCommandLibrefm ( string $user = null ) : void
$user string User identifier
return void

onLoad() public method

Check for dependencies.
public onLoad ( ) : void
return void

Property Details

$http protected_oe property

HTTP plugin
protected Phergie_Plugin_Http $http
return Phergie_Plugin_Http

$lastfmUrl protected_oe property

Last.FM API entry point
protected string $lastfmUrl
return string

$librefmUrl protected_oe property

Libre.FM API entry point
protected string $librefmUrl
return string

$query protected_oe property

Scrobbler query string for user.getRecentTracks
protected string $query
return string