Last.fm notes
This hasn't been updated for a while, so could be outdated (particularly if it's about something that evolves constantly, such as software). |
Contents
lastfm:// urls
This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, fix, or tell me) |
- lastfm://user/username (user's library)
- lastfm://user/username/personal (user's library)
- lastfm://user/username/neighbours
- lastfm://user/username/recommended
- lastfm://artist/artistname
- lastfm://artist/artistname/similarartists
- lastfm://artist/artistname/fans
- lastfm://globaltags/tag
- lastfm://group/groupname
- lastfm://rql/rql_as_base64 (see below)
No longer allowed:
- lastfm://user/username/loved - no longer allowed
- lastfm://usertags/username/tag - no longer allowed (player will go to global tags?)
Apparently not:(verify)
lastfm://user/username/playlistname lastfm://genre/genrename
RQL
RQL is a simple domain-specific query language used by last.fm. They work the same way as the above URLs.
Operators:
- and
- not - meaning 'and not'
- or
I'm not sure whether you can combine or meaningfully with the other two operators, and (relatedly) whether you can use brackets.
Query elements:
- tag:tagname
- user:username
- library:username
- rec:username - recommendations for the user
- neigh:username - neighbourhood
- adv:username - mix radio
- simart:"artist name" - similar artists
- group:"group name" or group:[groupid]
- Not available anymore: ptag, playlist, loved (verify)
Doublequotes should be used for any string that contains spaces.
Options (apparently should just be be appended; don't use and)
- opt:rep|0.5 - how quick a track is allowed to be played again
- opt:mainstr|0.5 - favour obscure or popular? (apparently adjusted for the (first bunch of) songs that will be played)
- opt:discovery|true - enable or disable discovery mode
Examples:
- lastfm://rql/dGFnOnBvcCBvcHQ6bWFpbnN0cnwwLjk=, meaningtag:pop opt:mainstr|0.9, common pop
- lastfm://rql/dGFnOnBvcCBvcHQ6bWFpbnN0cnwwLjA=, meaningtag:pop opt:mainstr|0.0, less common pop
- lastfm://rql/YWR2Omxhc3QuaHEgb3B0OmRpc2NvdmVyeXx0cnVl, meaningadv:last.hq opt:discovery|true, discovery mode mix radio for user last.hq
- lastfm://rql/dGFnOmJhZ3BpcGUgYW5kIHRhZzptZXRhbA==, meaningtag:bagpipe and tag:metal
- lastfm://rql/dGFnOmNvd2JlbGwgYW5kIHRhZzpyb2NrIG9wdDpyZXB8MC4y, meaningtag:cowbell and tag:rock opt:rep|0.2
Notes:
- I've has some specific requests not to work very well.
- I've had varying results to ordering the query elements in different ways (I could be thinking that up)
See also:
- http://www.lastfm.de/api/radio
- http://mpd.wikia.com/wiki/Last.fm_Radio
- http://burnysblog.blogspot.nl/2010/04/combo-station-urls.html
Running the Last.fm player from your browser
This hasn't been updated for a while, so could be outdated (particularly if it's about something that evolves constantly, such as software). |
This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, fix, or tell me) |
That is, telling it how to handle lastfm:// links.
Depending on your OS (and window manager), you can rely on some lower-level protocol registration instead.
Most of this ought to be outdated, because the installer is a little more thorough now.
Note that you can usually drag the lastfm:// links from the browser to the player; there is no need to type the addresses or rely on the system's protocol registration.
Firefox (linux, windows)
Basically:
- Surf to about:config (these are your firefox settings) and search (filter) for a key named network.protocol-handler.app.lastfm.
- If it doesn't yet exist, create it: Right-click anywhere in the config list, choose 'New' , the 'String' type, with network.protocol-handler.app.lastfm as the preference name.
- Its value should be the path to your player executable, eg. ~/Last.fm/player or /home/username/Last.fm/player.
You just created a handler for the lastfm:// protocol in firefox, which (re-)launches the executable with each lastfm:// URL.
The first time you use a link like this, firefox will ask you "this is an external program, do you want me to keep on warning you about this?". It's safe enough to turn the warning off, at least in non-evil environments (technically, trusting an application is bad security when that executable can be replaced with something bad).
In windows, the player's installer sets up what you need. If it didn't work, or more likely, if you downloaded the .zip because you have a low-permission work setup, follow the above instructions, but use a windows-style path, like "C:\Program Files\Last.fm Player\player.exe".
KDE protocol handler
You can register the protocol in KDE, which makes it usable from most places, including Konqueror and the run dialog. this link in the Last.fm forums suggests creating a lastfm.protocol file in the relevant KDE directory.
Apparently this is /usr/kde/3.4/share/services/lastfm.protocol for me and for KDE version 3.4.
To be sure for your setup, do aPut the following in the file (or copy from another and alter):
[Protocol] exec=/path/to/Last.fm/player %u protocol=lastfm input=none output=none helper=true listing= reading=false writing=false makedir=false deleting=false
Of course changing the path to a real one.
GNOME protocol handler
You can do something similar in GNOME. The settings would be visibile in the Configuration Editor (System Tools) but you cannot add a protocol in the GUI, so you need to do it from the command line:
gconftool-2 -s /desktop/gnome/url-handlers/lastfm/enabled --type bool true gconftool-2 -s /desktop/gnome/url-handlers/lastfm/command --type string "/path/to/Last.fm/player %s" gconftool-2 -s /desktop/gnome/url-handlers/lastfm/needs_terminal --type bool false
(It is possible that you need to run gconftool instead of gconftool-2, this is some version deal. I don't know, I rarely use GNOME) Things like Galeon, Epiphany and other GNOME apps should be able to handle lastfm:// links now.
Other
Beats me what, but feel free to add. Probably some less usual browsers can still be added, or fixing a broken windows setup.