mylesgrant.com

AJ Near Me

I finally made enough time to play with three things I’ve been wanting to check out: Yahoo! Fire Eagle, Google App Engine, and the Authentic Jobs API. The simple and useless result: AJ Near Me.

Let’s start with Fire Eagle. Fire Eagle is a location broker — you use one of the many available methods for it to keep track of your location, and it doles that out to applications to approve. In this case, the idea is that if you’re travelling in a new city, and Fire Eagle knows that you’re there, you might be interested in what jobs are currently available there. Highly unlikely, I know. And Fire Eagle isn’t even really necessary here — the app could and should simply ask for your current location. My killer app idea that actually uses Fire Eagle properly is automatic tracking of Caltrain trains and notification of delays via Twitter. I’ll never get that written, unfortunately.

Google App Engine is an interesting idea: Write your applications to use Google’s scalable infrastructure, and they’ll host it for free. Currently, it’s only available with Python — something that’s certainly not my strong suit. To make things even more potentially frustrating, it’s not vanilla Python either, so good luck using any third-party libs that use, say, urllib. Idiosyncrasies inside, I can’t pass up free scalable hosting, so I’ll probably be using it again in the future (as long as I don’t need cron *sigh*).

The AJ API is something I did a few months ago for Cameron and the site. Functionality is pretty basic: get a list of current job listings, filtered by type, keywords, company, etc. One of the bits that I wasn’t sure about, but tried anyway was to hook up with the geonames API to parse the user-entered job location bits and turn it into a lat/lon. There’s currently no search by lat/lon (but there is a sort of search by location) so this is most of the heavy lifting that the Google App Engine app does.

AJ Near Me maintains a list of current open listings, which it periodically fetches using the AJ API. When you visit the site after granting it permission to read your Fire Eagle location, the site fetches your current location from Fire Eagle. If your location is specific enough, the site searches the local database for all jobs within 50 miles of your location and displays them. Except that’s the more difficult part.

Typically, you would create your rough 50 mile bounding box and query the database for records within those four points. Except that in Bigtable, you can’t do inequality queries on more than one field at once (I’m serious). So instead, you store your locations as Geohashes/Geoindexes, convert your lower-left and upper-right bbox points to geoindexes and query the datastore like so:

query = Job.gql(”WHERE location_hash < :right AND location_hash > :left”, left=lower_left_index, right=upper_right_index)

This gets you close, and then you can use geopy’s great-circle distance calculation function to whittle it down to records actually within 50 miles of your location.

Like I said, a useless idea, but learning about geohashes and bounding box calculations made it worth it. Fire Eagle is a fantastic product and I have high hopes for it — and about a thousand ideas. Google App Engine can be frustrating, but totally perfect for small projects. I’ll be using it again for sure. And if they ever release a PHP version of it, I’ll put BlogSkins on it in a heartbeat.


No Comments Yet


There are no comments yet. You could be the first!

Leave a Comment

Pixar’s movies in order of Metacritic score I have a code.flickr.com blog post!


ss_blog_claim=15f221fa5534b36dfd4dc0c2bcca99c1