cl-scrobbler is a Common Lisp library for scrobbling to last.fm.
It was initially designed to make it trivial to build a last.fm plugin for shuffletron but it should be useful to other hackers interested in scrobbling via CL, for whatever reason.
Install You could git clone this library and make sure it's path on your computer is on your
but I strongly recommend that you instead use Zach Beane's positively delightful quicklisp.
- Using quicklisp: Start your lisp. Run
- Install cl-scrobbler
- Check out the docs or see how I used it below.
The Shuffletron Example It is recommended to simply mirror the shuffletron plugin. Here's a handwavy explanation of that code:
You should set
so that the
variables can be updated with the current track position and metadata, respectively. Then you can have hooks in your application to call
when a song ends,
when a song begins, and, if applicable,
after a seek finishes and
after skipping the track.
Finally, you should fire off a thread to call
which will do the work of creating or restoring the session key and cache and then scrobbling tracks when possible.