.:aaron.helton:.

Google hasn’t mapped my thoughts just yet, so don’t get lost

Walk Score Ubiquity Command

leave a comment »

I’ve found myself interested in the Walk Score results for all of the potential locations I am looking at online for when I relocate. Incidentally, I have been using Ubiquity, Mozilla’s handy extension that puts semantic-web-like capabilities in the hands of end-users.  One of the features I use the most is the “map” command, which takes your highlighted text as the input for a Google Maps query.  This is great for just displaying a map, but I also want to check the Walk Score without having to open a new tab, browse to the Walk Score web site, then paste in the address.  So I created my own Ubiquity command that does this for me.  All I have to do now is highlight an address, bring up the Ubiquity interface (read Ubiquity site for more info on that), and start typing “walkscore.”  Once it tells me in my preview area about the command to be executed and the selection it has, I press Enter, and I’m taken straight to the Walk Score page for that address.

Installation

If you haven’t already done so, you’ll need to install Ubiquity.  Once you do that, the walkscore command is available automatically from here, but you can also just copy and paste my code into your Ubiquity command editor.

Let’s see if this works:

CmdUtils.CreateCommand({
  name: "walkscore",
  homepage: "http://heltons.mooo.com/ubiq/",
  author: {name: "Aaron Helton", email: "mariusagricola@gmail.com"},
  license: "GPL",
  description: "For any address you can map in Google Maps, you can
  also get your walk score",
  help: "Finds the Walk Score for any address you can find in Google
  Maps.  Try using a full address for the narrowest and most accurate
  result.",
  takes: {"input": /.*/},
  preview: function(pblock, input) {
    pblock.innerHTML = "Get the Walk Score for <b>" + input.text +
    "</b>.";
  },
  execute: function(input) {
    //displayMessage("Get the Walk Score for: " + input.text);
    var wsloc = input.text;
    var wsurl = "http://www.walkscore.com/get-score.php?street=" +
     escape(wsloc) + "&go=Go";
    Utils.openUrlInBrowser( wsurl );
  }
});

It’s short and sweet, but quite useful for me.  If you find it similarly useful, let me know.  Also, I’ll be happy to help work out any issues you find (especially if Walk Score changes their query structure).  Oh, and if the link to my home server doesn’t work, just get the code from this page.  I will most likely be relocating soon, and the server could be offline for a bit.

Written by aaronhelton

April 3, 2009 at 6:37 pm

Leave a Reply