Skip to content

Instantly share code, notes, and snippets.

Created July 29, 2009 23:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/158453 to your computer and use it in GitHub Desktop.
Save anonymous/158453 to your computer and use it in GitHub Desktop.
/* This is the walkscore command updated for Ubiquity 0.5 */
CmdUtils.CreateCommand({
names: ["walkscore"],
description: "Finds the Walk Score for a particular address.",
help: "Try "walkscore austin tx" to see the Walk Score for that city. It is best if you use a more complete address, as the result will be more accurate.",
author: {name: "Aaron Helton", email: "mariusagricola@gmail.com"},
license: "GPL",
homepage: "http://aaronhelton.wordpress.com",
arguments: [{role: 'object', nountype: noun_arb_text}],
preview: function preview(pblock, args) {
pblock.innerHTML = "Find the Walk Score for <b>" + args.object.html + "</b>.";
},
execute: function execute(args) {
//displayMessage("You selected: " + args.object.text, this);
var wsloc = args.object.text;
var wsurl = "http://www.walkscore.com/get-score.php?street=" +
escape(wsloc) + "&go=Go";
Utils.openUrlInBrowser( wsurl );
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment