New Gastro features, and tech details

I pushed two new features on Gastro last night: GeoRSS support, and a JSON export.

This should make it a lot easier to take the data i’ve scraped and reuse it. Feel free to grab it and play with it as you will!

You should be able to take the GeoRSS feed and pipe it straight into Google Maps (paste the feed url into the search bar), however GMaps doesn’t seem to like fetching the feed.

It might be something to do with a reported DNS issue. If anyone has a free second to do a dig and see if anything is boned I would be very appreciative.

The new release also has a bunch of performance improvements (i’ve basically halved the app load time), and the info window on the map points display the restaurant names.

Simon wanted to know the tech details, so here they are:

The mashup is a collection of small Ruby apps.

There’s a scraper, which handles caching copies of the food authority site locally, extracting meaningful data from the cached copies, geocoding against the extracted address data, and writing that data out in an easy-to-parse format (YAML).

The geocoding is done against Google’s geocoding service, using the ym4r library. I serialise the store the lat/lng data back to the YAML.

The website is written in Merb (though I am considering rewriting it in nanoc), and uses an in-memory Sqlite3 database that’s created from the YAML data every time the app boots. This means the app takes about 10 seconds to boot, but access to all the data is pretty damn quick once the app is up.

I’m caching the JSON/RSS/HTML pages just in case it gains momentum and my server gets hammered. I’m using the standard Merb::Cache caching mechanism, which generates new page fragments every 30 minutes.

The app is running under 2 Mongrels with apache2 + mod_proxy_balancer and it seems to cope ok. I’ve had 70 unique visits in the last 24 hours so i’m not particularly worried about load.

If you want to check out the code, you can grab a copy of my repo with a

$ bzr branch http://holmwood.id.au/~lindsay/code/gastro

There are a bunch of rough edges (no documentation, notice urls aren’t serialised yet, ~70 addresses can’t be geocoded, and geocode data can be easily overwritten), but interested folk might like a stickybeek.

Spread the word if you like it! New features are pending. :-)