Welcome! As promised in my previous post, today I am releasing a Greasemonkey script that allows geocoding, using the geo microformat, in Blogger‘s interface. Remember my previous fit of creativity concerning names? Well, I’ve decided to name this one InsertGeo (don’t laugh at me, just click on this link if you want to install it without reading any further; of course, this assumes Greasemonkey is already installed and in good working order on your Firefox). The screen capture next to this paragraph gives an idea about what to expect after installation.
This script will add a button to the Edit Html editor tab on Blogger’s new post and edit post pages. You may select some text in the editing area before pressing the button; the text box will appear filled with the selected text, which may be edited. Or you might prefer not to select anything beforehand: just enter in the text box the address you want to have geocoded. Press OK, and after a (hopefully) short wait you will see the geo microformat code entered in your post.
This is the kind of code the script generates for a certain address (incidentally, where I spent my much remembered last vacations):
- Address to geocode:
Avenida de la Mojarra, Ayamonte, Huelva, Spain
- Microformat generated:
<span class="geo">Avenida de la Mojarra, Ayamonte, Huelva, Spain ( <abbr class="latitude" title="37.186030">37º11'10" N</abbr> <abbr class="longitude" title="-7.338429">7º20'18" W</abbr>) </span>
- Live result (try it with Operator):
Avenida de la Mojarra, Ayamonte, Huelva, Spain (37º11’10″ N 7º20’18″ W)
The actual geocoding is performed by Yahoo Pipes. There are other services available on the Net, but the flexibility and extensibility of Pipes is as hard a match as you could find. The pipe I am using (also by yours truly) is called geoloc_pipe; if you take a peek at it, you will notice that there is more data built into the feed than it’s needed to compose a geo microformat. In fact, just enough to generate an adr microformat. An idea for further development?