Skip to content

Instantly share code, notes, and snippets.

/walkscore-0.5.js
Created Jul 29, 2009

Embed
What would you like to do?
/* 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
You can’t perform that action at this time.