프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$keyParam | string | Override the key param, since, again, Lastfm wants to be different. | |
$responseFormat | string | Specify the response format, since Last.fm only returns XML. |
메소드 | 설명 | |
---|---|---|
__construct ( string $key = null, string $secret = null, |
Construct an instance of Lastfm service. | |
buildAuthCallParams ( array $params, boolean $toString = false ) : array | string | Build the parameters to use for _authenticated_ Last.fm API calls. | |
enabled ( ) : boolean | Determine if Last.fm integration is enabled. | |
getAlbumInfo ( string $name, string $artistName ) : array | false | Get information about an album. | |
getArtistInfo ( $name ) : array | false | Get information about an artist. | |
getSessionKey ( string $token ) : string | Get Last.fm's session key for the authenticated user using a token. | |
scrobble ( string $artist, string $track, string | integer $timestamp, string $album, string $sk ) : boolean | Scrobble a song. | |
toggleLoveTrack ( string $track, string $artist, string $sk, boolean $love = true ) : boolean | Love or unlove a track on Last.fm. | |
updateNowPlaying ( string $artist, string $track, string $album, integer | float $duration, string $sk ) : boolean | Update a track's "now playing" on Last.fm. | |
used ( ) : boolean | Determine if our application is using Last.fm. |
메소드 | 설명 | |
---|---|---|
formatText ( string $str ) : string | Correctly format a string returned by Last.fm. |
public __construct ( string $key = null, string $secret = null, |
||
$key | string | Last.fm API key. |
$secret | string | Last.fm API shared secret. |
$client | The Guzzle HTTP client. |
protected formatText ( string $str ) : string | ||
$str | string | |
리턴 | string |
public getArtistInfo ( $name ) : array | false | ||
$name | string Name of the artist | |
리턴 | array | false |
public getSessionKey ( string $token ) : string | ||
$token | string | The token after successfully connecting to Last.fm |
리턴 | string | The token key |
public updateNowPlaying ( string $artist, string $track, string $album, integer | float $duration, string $sk ) : boolean | ||
$artist | string | Name of the artist |
$track | string | Name of the track |
$album | string | Name of the album |
$duration | integer | float | Duration of the track, in seconds |
$sk | string | The session key |
리턴 | boolean |
protected string $keyParam | ||
리턴 | string |
protected string $responseFormat | ||
리턴 | string |