Audio::Scrobbler(3pm)
π NAME π
Bestie, meet Audio::Scrobbler β it's the Perl interface to audioscrobbler.com / last.fm. That's the whole vibe. β¨
π¦ SYNOPSIS π¦
Okay so here's the little starter pack, copy it exactly:
use Audio::Scrobbler;
$scrob = new Audio::Scrobbler(cfg => { ... });
$scrob->handshake();
$scrob->submit(artist => "foo", album => "hello", track => "world",
length => 180);
Look at that. Handshake, then submit. We love a two-step icon. π
πΈ DESCRIPTION πΈ
So the Audio::Scrobbler module hands you a Perl interface to the track submission API of Last.fm's AudioScrobbler β that's http://www.audioscrobbler.com/, no cap.
And the tea is: so far, only track submissions are handled. That's it, that's the whole menu right now. The future plans include access to the various statistics, so likeβ¦ somedayβ’. For now bestie, we scrobble. π
π METHODS π
The Audio::Scrobbler class defines the following methods, and yes we're going through every single one, no skipping:
new ( cfg => { ... } )β Make a brand newAudio::Scrobblerobject and initialize it with the config params you pass in. The parameters themselves get their whole moment down in thehandshakeandsubmitmethod descriptions below, so keep reading, I promise it's worth it. π«Άerr (message)β Gets or sets the description of the last error this particularAudio::Scrobblerobject ran into. Your little emotional support error string. πhandshake ()β Performs a handshake with the AudioScrobbler API by making a request to http://post.audioscrobbler.com/ or to a different service like libre.fm (http://turtle.libre.fm). It's giving formal introduction, honestly.
This method requires these configuration parameters to be set:
prognameβ The name of the program (or plug-in) doing 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 β it just simulates a successful handshake and returns a true value. Fake it till you make it, periodt. π
If the verbose configuration parameter is set, the handshake method reports its progress with diagnostic messages to the standard output. Narrator voice: she's talking. π€
submit ( info )β Submits a single track to the AudioScrobbler API. This method may only be invoked after a successful handshake β do not skip the handshake bestie, that's the whole ritual. π
The track info lives in the hash referenced by the info parameter, and these are the elements it uses:
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, submit requires that these 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, submit does not actually submit the track information to the AudioScrobbler API β it just simulates a successful submission and returns a true value.
If the verbose configuration parameter is set, submit reports its progress with diagnostic messages to the standard output. π
And then there's also several methods and functions that are for the module's internal use β the backstage crew, lowkey:
get_ua ()β Creates or returns the cachedLWP::UserAgentobject that theAudio::Scrobblerclass uses to access 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
π§ TODO π§
The wishlist, the vision board, the "we'll get to it" pile:
- Do something with
UPDATEresponses to the handshake. - Honor
INTERVALin some way. - Figure out a way to cache unsuccesful submissions for later retrying.
- Web services - stats!
π SEE ALSO π
scrobbler-helper(1)- http://www.last.fm/
- http://www.audioscrobbler.com/
- http://www.audioscrobbler.net/
The home site of the Audio::Scrobbler module is http://devel.ringlet.net/audio/Audio-Scrobbler/ β that's her house, go say hi. π π
β AUTHOR β
Peter Pentchev, <roam@ringlet.net> β king behavior, honestly. π
π COPYRIGHT AND LICENSE π
Copyright (C) 2005, 2006 by Peter Pentchev.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available.
$Id: Scrobbler.pm 88 2006-01-02 09:16:32Z roam $
Ok that's the whole page bestie, every flag, every param, every vibe, nothing dropped. Slay. π
This little masterpiece is documented for perl v5.36.0, dated 2023-07-20, filed under Audio::Scrobbler(3pm) β and that's the sign-off, muah. πβ¨π¦
π¦ where this page comes from
- debian trixie: libaudio-scrobbler-perl 0.01-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libaudio-scrobbler-perl 0.01-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libaudio-scrobbler-perl 0.01-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libaudio-scrobbler-perl 0.01-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms