-
-
Save ba3r/160846 to your computer and use it in GitHub Desktop.
last.fm radio starter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CmdUtils.CreateCommand({ | |
names: ["radio", "last.fm radio"], | |
icon: "http://cdn.last.fm/flatness/nice_favicon.png", | |
homepage: "www.last.fm", | |
author: {name: "Michael Baer", homepage: "http://twitter.com/synapsos"}, | |
license: "GPL", | |
description: "Last.FM radio starter - works with 0.5+ (Parser 2)", | |
help: "Type radio followed by the artist you want to listen to.", | |
arguments: [{role: 'object', nountype: noun_arb_text, label: "artist name"}], | |
preview: function(pblock, args) { | |
pblock.innerHTML = "Start radio for: <b>" + args.object.text + "</b> and similar artists"; | |
}, | |
execute: function(args) { | |
var input = args.object.text ; | |
var output = input.replace(/\s+/g,"%20"); | |
displayMessage("Starting " + args.object.text + " radio. Enjoy!"); | |
Utils.openUrlInBrowser( "http://www.last.fm/listen/artist/" + output + "/similarartists" ); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment