The "Audio::Scrobbler" class defines the following methods:
• new ( cfg => { ... } )
Create a new "Audio::Scrobbler" object and initialize it with the provided configuration parameters.
The parameters themselves are discussed in the description of the handshake and submit methods below.
• err (message)
Retrieves or sets the description of the last error encountered in the operation of this
"Audio::Scrobbler" object.
• handshake ()
Perfors a handshake with the AudioScrobbler API via a request to http://post.audioscrobbler.com/ or a
different service like libre.fm (http://turtle.libre.fm).
This method requires that the following configuration parameters be set:
• progname
The name of the program (or plug-in) performing the AudioScrobbler handshake.
• progver
The version of the program (or plug-in).
• username
The username of the user's AudioScrobbler registration.
Optional parameter:
• service
The URL of the AudioScrobbler service to use, defaults to http://post.audioscrobbler.com/.
http://turtle.libre.fm or other libre.fm instances should also work.
If the handshake is successful, the method returns a true value, and the submit method may be
invoked. Otherwise, an appropriate error message may be retrieved via the err method.
If the fake configuration parameter is set, the handshake method does not actually perform the
handshake with the AudioScrobbler API, just simulates a successful handshake and returns a true
value.
If the verbose configuration parameter is set, the handshake method reports its progress with
diagnostic messages to the standard output.
• submit ( info )
Submits a single track to the AudioScrobbler API. This method may only be invoked after a
successful handshake. The track information is contained in the hash referenced by the info
parameter; the following elements are used:
• title
The track's title.
• artist
The name of the artist performing the track.
• length
The duration of the track in seconds.
• album
The name of the album (optional).
Also, the submit method requires that the following configuration parameters be set for this
"Audio::Scrobbler" object:
• username
The username of the user's AudioScrobbler registration.
• password
The password for the AudioScrobbler registration.
If the submission is successful, the method returns a true value. Otherwise, an appropriate error
message may be retrieved via the err method.
If the fake configuration parameter is set, the submit method does not actually submit the track
information to the AudioScrobbler API, just simulates a successful submission and returns a true
value.
If the verbose configuration parameter is set, the submit method reports its progress with diagnostic
messages to the standard output.
There are also several methods and functions for the module's internal use:
• get_ua ()
Creates or returns the cached "LWP::UserAgent" object used by the "Audio::Scrobbler" class for access
to the AudioScrobbler API.
• URLDecode (string)
Decode a URL-encoded string.
Obtained from http://glennf.com/writing/hexadecimal.url.encoding.html
• URLEncode (string)
Return the URL-encoded representation of a string.
Obtained from http://glennf.com/writing/hexadecimal.url.encoding.html