Note to self: Google provides free IP Geolocation

This is why I like tinkering with new things: not only do I learn said new thing, but I tend to learn a lot more. For example, I’ve been hacking on a random Rails app since last Friday, to help me experience first-hand Git, GitHub, Collaborative Filtering, restful_authentication, attachment_fu, RSpec, etc.

Then I decided to dive into jQuery. I’m no level 67 front-end master, but I like to pretend I can fake it until I make it. And, since jQuery seems to be getting all the attention these days, I figured I’d check it out. One thing I thought about, with regards to loading big javascript files is the size. Caching is obviously good. That thought brushed off the cobwebs in my brain and reminded me that Google hosts many JS frameworks you can use, meaning the user may already have it loaded.

I looked up the Google hosting, which brought me to Google AJAX Libraries API. I dove in a little deeper and found this:

google.loader.ClientLocation
When an application makes use of the AJAX API loader, the loader attempts to geo locate the client based on it’s IP address. If this process succeeds, the client’s location, scoped to the metro level, is made available in the google.loader.ClientLocation property.

There are lots of IP geolocation solutions out there, but they’re often bad and/or expensive. But, because of random tinkering, I now know of a good solution for free. And this post will forever serve to remind me of that fact.

Wednesday, January 21, 2009   ()