Created
July 29, 2009 23:17
-
-
Save anonymous/158453 to your computer and use it in GitHub Desktop.
This file contains 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
/* 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