This is the cl-scrobbler Reference Manual, version 0.4, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 05:21:45 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
cl-scrobbler
A library for scrobbling to last.fm
Brit Butler <redline6561@gmail.com>
BSD
0.4
md5
(system).
flexi-streams
(system).
drakma
(system).
st-json
(system).
cl-store
(system).
arnesi
(system).
src
(module).
Modules are listed depth-first from the system components tree.
cl-scrobbler/src
cl-scrobbler
(system).
package.lisp
(file).
config.lisp
(file).
cache.lisp
(file).
errors.lisp
(file).
util.lisp
(file).
auth.lisp
(file).
scrobble.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
cl-scrobbler/cl-scrobbler.asd
cl-scrobbler/src/package.lisp
cl-scrobbler/src/config.lisp
cl-scrobbler/src/cache.lisp
cl-scrobbler/src/errors.lisp
cl-scrobbler/src/util.lisp
cl-scrobbler/src/auth.lisp
cl-scrobbler/src/scrobble.lisp
cl-scrobbler/src/config.lisp
package.lisp
(file).
src
(module).
*config-dir*
(special variable).
*scrobble-count*
(special variable).
*api-key*
(special variable).
*api-secret*
(special variable).
*api-url*
(special variable).
*api-version*
(special variable).
*now-playing-p*
(special variable).
*scrobble-p*
(special variable).
*session-key*
(special variable).
restore-settings
(function).
save-settings
(function).
cl-scrobbler/src/cache.lisp
config.lisp
(file).
src
(module).
cache-contents
(function).
*scrobble-cache*
(special variable).
add-to-cache
(function).
persist-cache
(function).
remove-from-cache
(function).
restore-cache
(function).
cl-scrobbler/src/errors.lisp
cache.lisp
(file).
src
(module).
*error-codes*
(special variable).
add-log-entry
(function).
error-message
(function).
lastfm-server-error
(condition).
message
(reader method).
scrobble-error
(condition).
with-logging
(macro).
cl-scrobbler/src/util.lisp
errors.lisp
(file).
src
(module).
config-file
(function).
defcall
(macro).
frob-lastfm-name
(function).
frob-symbol
(function).
ksymb
(function).
lastfm-call
(function).
make-param
(function).
make-signature
(function).
md5sum
(function).
mkstr
(function).
simplified-camel-case-to-lisp
(function).
simplified-lisp-to-camel-case
(function).
symb
(function).
unix-timestamp
(function).
cl-scrobbler/src/auth.lisp
util.lisp
(file).
src
(module).
authorize-scrobbling
(function).
get-session
(function).
get-session-key
(function).
get-token
(function).
request-user-auth
(function).
cl-scrobbler/src/scrobble.lisp
auth.lisp
(file).
src
(module).
*song-info-fn*
(special variable).
*song-time-fn*
(special variable).
maybe-queue-scrobble
(function).
scrobbler-init
(function).
scrobbler-loop
(function).
set-now-playing
(function).
toggle-now-playing
(function).
toggle-scrobbling
(function).
update-last-seek
(function).
update-skipped
(function).
update-song-info
(function).
*last-seek*
(special variable).
*skipped*
(special variable).
*song-info*
(special variable).
attempt-scrobble
(function).
scrobble
(function).
update-now-playing
(function).
valid-scrobble-p
(function).
Packages are listed by definition order.
cl-scrobbler
Homepage: <a href="http://github.com/redline6561/cl-scrobbler">Github</a>
common-lisp
.
*config-dir*
(special variable).
*scrobble-count*
(special variable).
*song-info-fn*
(special variable).
*song-time-fn*
(special variable).
cache-contents
(function).
maybe-queue-scrobble
(function).
scrobbler-init
(function).
scrobbler-loop
(function).
set-now-playing
(function).
toggle-now-playing
(function).
toggle-scrobbling
(function).
update-last-seek
(function).
update-skipped
(function).
update-song-info
(function).
*api-key*
(special variable).
*api-secret*
(special variable).
*api-url*
(special variable).
*api-version*
(special variable).
*error-codes*
(special variable).
*last-seek*
(special variable).
*now-playing-p*
(special variable).
*scrobble-cache*
(special variable).
*scrobble-p*
(special variable).
*session-key*
(special variable).
*skipped*
(special variable).
*song-info*
(special variable).
add-log-entry
(function).
add-to-cache
(function).
attempt-scrobble
(function).
authorize-scrobbling
(function).
config-file
(function).
defcall
(macro).
error-message
(function).
frob-lastfm-name
(function).
frob-symbol
(function).
get-session
(function).
get-session-key
(function).
get-token
(function).
ksymb
(function).
lastfm-call
(function).
lastfm-server-error
(condition).
make-param
(function).
make-signature
(function).
md5sum
(function).
message
(generic reader).
mkstr
(function).
persist-cache
(function).
remove-from-cache
(function).
request-user-auth
(function).
restore-cache
(function).
restore-settings
(function).
save-settings
(function).
scrobble
(function).
scrobble-error
(condition).
simplified-camel-case-to-lisp
(function).
simplified-lisp-to-camel-case
(function).
symb
(function).
unix-timestamp
(function).
update-now-playing
(function).
valid-scrobble-p
(function).
with-logging
(macro).
Definitions are sorted by export status, category, package, and then by lexicographic order.
The directory to store the session key, scrobble cache and log in.
The number of songs needed in the queue before an attempt to scrobble is made.
This is a lambda or named function intended to take no arguments and return a list where the first element is the track name, the second is the artist and the third is the track length in seconds.
This is a lambda or named function intended to take no arguments and return the current position in the track in seconds.
Get a copy of the contents of the *SCROBBLE-CACHE*.
When valid (as determined by VALID-SCROBBLE-P), add a song to the queue to be scrobbled. If there is a network failure, the track will be stored for later scrobbling when a connection is reestablished.
Ensure needed variables are set, restore the cache and settings if present and, if scrobbling is enabled, restore or acquire a session key.
Loop indefinitely. If there are at least *SCROBBLE-COUNT* songs queued, scrobble until the queue is empty or errors occur. Sleep 2 minutes and repeat.
Update the now playing status when *NOW-PLAYING-P* is non-NIL.
Toggle whether or not the Now Playing status is updated with each song.
Toggle whether or not new songs are added to the queue.
Set *LAST-SEEK* to the current track position via *SONG-TIME-FN*.
Set *SKIPPED* to the current track position via *SONG-TIME-FN*.
Set *SONG-INFO* to a list of (track artist duration timestamp) via *SONG-INFO-FN* and UNIX-TIMESTAMP.
A valid Last.fm API key.
A valid Last.fm API secret key.
The URL for Last.fm API calls.
The current Last.fm API version.
A list of Last.fm Error codes. Duh. From http://www.last.fm/api/errorcodes
The destination position in seconds of the last seek in the current track.
This variable determines whether the user’s now playing status is updated.
A queue of cached scrobbles to send when last.fm is available.
This variable determines whether or not songs are added to the scrobble cache.
The session key used to authenticate calls to last.fm.
Either NIL or the position in seconds before the user skipped to the next track.
A list of (track artist length timestamp) of type (string string int string) or NIL.
Define a function named by (FROB-LASTFM-NAME NAME) which calls the API method named by NAME with the given PARAMETERS. The result is bound to RESPONSE, the HTTP status code to STATUS and the headers to HEADERS, then BODY is executed in this environment. Note that this macro is thus unhygienic. DOCS is used to supply a docstring and METHOD determines the HTTP method to use.
Execute BODY in a handler-case such that network failure or any error message from the server results in logging the error to disk via ADD-LOG-ENTRY.
Format ARGS and append the line to the cl-scrobbler log file, creating it if it does not exist.
Add the SCROBBLE to the cache and serialize it to disk.
Peek at *SCROBBLE-CACHE* and attempt to scrobble the next song. If successful, remove the song from the cache and persist it to disk.
Authorize cl-scrobbler to scrobble to an account, saving the session key in a binary file and setting the *SESSION-KEY* global on success.
Return a pathname for NAME under *CONFIG-DIR* ensuring the directory exists.
Retrieve the error message corresponding to the number ERRCODE.
Lispify Last.fm method names. i.e. "auth.getToken" -> ’get-token
camelCase Lisp symbols. i.e. ’frob-lisp-symbol -> "frobLispSymbol"
Get a Session Token for scrobbling. Last.fm recommends storing these in a secure fashion as they generally have an infinite lifetime.
Attempt to retrieve session key from disk. If it is not present, authorize a new session with last.fm and store the key for future use.
Get an Unauthorized Token for initiating an authenticated session.
Make an HTTP request to the *API-URL* with the specified METHOD and PARAMS. PARAMS should be a list of dotted pairs.
Return a cons, or list of conses if VAL is a list, suitable for use as a POST parameter or GET queryparam in a last.fm call. SYM is converted to a camelCase string and, if VAL is a list, append C-style array indices to SYM.
Construct an API method signature from PARAMS.
Creates an MD5 byte-array of STRING and prints it as lower-case hexadecimal.
Persist the cache to disk.
Remove the last scrobble from the cache and persist the cache.
Ask the user to authorize cl-scrobbler to submit songs.
Restore the cache from disk.
Restore the *SCROBBLE-COUNT*, *SCROBBLE-P* and *NOW-PLAYING-P* variables.
Persist the *SCROBBLE-COUNT*, *SCROBBLE-P* and *NOW-PLAYING-P* settings.
Scrobble the track!
Lispify camelCase or CamelCase strings to camel-case.
This is a very naive lisp symbol to camel-case converter. It is not designed to be robust, merely to handle local variables in the typical lisp style.
Cross-implementation abstraction to get the current time measured from the unix epoch (1/1/1970). Should return (values sec nano-sec).
Update the Now Playing status on last.fm.
Last.fm defines a valid scrobble as a track that is over 30 seconds long which has been played for over half its length OR 4 minutes. We extend this notion such that playtime must have occurred without seeking.
lastfm-server-error
)) ¶Jump to: | A C D E F G K L M P R S T U V W |
---|
Jump to: | A C D E F G K L M P R S T U V W |
---|
Jump to: | *
M S |
---|
Jump to: | *
M S |
---|
Jump to: | A C E F L M P S U |
---|
Jump to: | A C E F L M P S U |
---|