Requirements
moc-scrobbler requires a machine that knows Bash and has cURL to do the RESTful requests to lastfm. If you are on a *nix machine you should be OK.
If you want to submit your tracks to last.fm using Music on Console (dubbed MOC) this script is for you.
moc-scrobbler requires a machine that knows Bash and has cURL to do the RESTful requests to lastfm. If you are on a *nix machine you should be OK.
Download or clone the script to your executable directory, some common options are:
~/bin/
/usr/local/bin/
Then run chmod +x /path/to/moc-scrobbler
and reset your terminal so bash acknowledges its existence.
There are two ways to do this:
The advantage of this is that you will save 2 or 3 requests to get API signatures, also if you are concerned about your listening privacy this makes more sense.
To get connected:
Then run in connect mode replacing the abcdef123456789...
bit with your own keys:
moc-scrobbler --connect --api_key=abcdef123456789... --api_sec=abcdef123456789...
This option will set you up to scrobble but each track you send will first call moc-scrobbler to sign the request before sending it to lastfm. Also this service may stop working at any time without prior notice!
Run the following and follow the setup authorizing the app to scrobble on your behalf.
moc-scrobbler --connect
To make MOC scrobble each song after playback you need to call moc-scrobbler after the track has been called. This is done using the OnSongChange
and OnStop
settings at the end of your ~/.moc/config
file.
OnSongChange = "/usr/local/bin/moc-scrobbler --update --ask-moc"
OnStop = "/usr/local/bin/moc-scrobbler --stop"
Remember to use the full path to moc-scrobbler and not a relative or expandable path.
Note that you must restart MOC Shift + Q for the changes to take effect.
A full list of options is:
About
--help
--version
--about
Connecting
--connect --api_key=abcdef... --api_sec=abcdef...
Scrobbling
--artist="artist name" --track="song name"
--ask-moc
Update Current Song
--update --artist="artist name" --track="song name"
--update --ask-moc
Stop
--stop
Here is an example that scrobbles a track to lastfm, note the double quotes:
moc-scrobbler --artist="Piero Umiliani" --track="Mah Nà Mah Nà"
Remember to escape double quotes:
moc-scrobbler --artist="Lee \"Scratch\" Perry" --track="Locks In The Dublight"
The configuration file and log for moc-scrobbler are located in ~/.config/moc-scrobbler/
and it contains the following files:
moc-scrobbler.conf
scrobbles.log
track.current
and track.last