Skip to content

Commit

Permalink
Merge pull request #111 from mdrxy/scrobble
Browse files Browse the repository at this point in the history
Add Last.fm scrobbling instructions to Liquidsoap documentation
  • Loading branch information
BusterNeece authored Nov 28, 2024
2 parents 614d919 + c6cb18a commit 950eb62
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/content/docs/docs/developers/liquidsoap.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,23 @@ docker-compose exec --user=azuracast web liquidsoap -h ladspa.plugin
We have modified the [MK Pascal script](https://github.com/mkpascal/mk_liquidsoap_processing/blob/master/process.liq) to work with AzuraCast.

You can check out the [full script here](https://gist.github.com/BusterNeece/43a06ee6624975273fdc903ba4a39998) that you can include in your Liquidsoap configuration via the `Utilities` -> `Edit Liquidsoap Configuration` page of your station after enabling the [Advanced Features](/docs/administration/advanced-features).

## Scrobbling to Last.fm

Liquidsoap has a native [Last.fm](https://www.last.fm/) extension builtin. To use it, you just need to add some custom code to your Liquidsoap config in the third text box (underneath `add_skip_command(radio)`).

```ruby
def lastfm.submit(~user,~password,~source="broadcast",~length=false) =
fun (m) ->
if (m["jingle_mode"] != "true") then
audioscrobbler.submit(user=user,password=password,
source=source,length=length,
host="post.audioscrobbler.com",port=80,
m)
end
end

radio.on_metadata(lastfm.submit(user="USER",password="PASS"))
```

This code submits a scrobble each time the currently playing track changes. You must change `USER` and `PASS` to reflect the Last.fm login credentials of the account you wish to scrobble to.

0 comments on commit 950eb62

Please sign in to comment.