Kilroy was here

Myth has it that ‘Kilroy was here’ was the mark of a shipbuilder before/during WWII, and that it was picked up by Servicemen who found it amusing that the mark was made in supposedly unreachable places. They then spread the mark elsewhere, as locations around the world were liberated.  I love this concept, because I’m not a fan of limitations — I’m an avid gamer, but I rail against games that don’t let you stray from the path. There is no variety, or replay value because each time you have exactly the same sequence of events.

Many hopeful web developers fall into this pitfall as well. I was reading http://www.adaptivepath.com/blog/2009/10/27/desire-lines-the-metaphor-that-keeps-on-giving/, a(nother) look at a metaphor called ‘desire lines’, that has similarly important lessons for the web2.0 community. You can’t force people to do what you want. The lesson is simple and played out all around us, you can set down a path, but you can’t make people want to use that route. A good designer will probably preempt a lot of what people will want, but not everything, and the overnight success that all of us are searching for is a bit hit and miss. Plenty of good ideas are out there, but finding something that people actually want, and then getting the word out there that you’re product is there is tough.

Or something like that.

Getting started with Google Maps

My first few searches turned up some fairly unpolished methods of accessing Google Maps from Ruby. I’m definitely using Ruby as a starting point in this challenge, its the language I’m most comfortable with. That’s not to say that I’m not going to do any other languages. I do want to do a Python/Django project at some point, just to get it out of the way.

After bit of digging around I discovered the YM4R gem. YM4R provides access to the Google Maps and the Yahoo! Maps Building Block API’s. Before we go any further lets just get a Google Map on the page and point it at a location. The gem also comes as a plugin for rails, which I’m about to find out has some different capabilities (more on that later).

To do that we need to get an API key here. Making sure to put in whatever url you will be using to access your application, in my case, at least for the example application, that’s http://localhost:4567. If you’re familar with the port number then you know that I’m using Sinatra rather than Rails, this means, is that I can’t use the YM4R/GM rails plugin (at least without hacking it up) & unlike the plugin the gem doesn’t contain the code to actually generate the map code. So I’m back to the drawing board.

Taking a step back I have a look at how difficult it is to just get it onto the page without a helper, which as it turns out is ‘not very’. Lets look at the code to get a minimal example happening:

And the view:

Google Maps Example Application Screenshot

Google Maps Example Application Screenshot

As you can see, It’s pretty simple to get a nice looking Google Map onto the page. In the next post I’ll go into the details of how to start manipulating the map for our purposes.

Foursquare

Apparently the idea for my Google Maps API part of my challenge has already been done by foursquare. Dammit, that was a good idea too. They’ve taken it to the next level as well, making it possible to complete badges (much like Stackoverflow and/or Kongregate). It’s a bit limited, in that you can’t have it in every city right now, but it should be fun to play with and might get a solid following from people with smartphones and people that love the whole geo-tagging phenomenon. Oh well, back to the drawing board, this was probably a bit complex for a week long project anyway.

The API Challenge

One of my favorite finds this year is Programmable Web, a site dedicated to APIs and Mashups that are the lifeblood of web 2.0. Having just watched the movie Julie & Julia, which I highly recommend, I think that its only appropriate that I set myself a similar challenge. Take the top 50 apis, and within the next year develop a non trivial application for each of them (in no particular order). I’ve set myself a couple of rules:

  • You are allowed to use any client libraries if they exist.
  • Using multiple APIs in the one application is allowed (yay for mashup’s)
  • Any libraries/applications that are developed in the course of the challenge must have tests/specs and documentation.
  • And of course blog about each api.

First up:

  • API: Google Maps
  • Deadline: Thursday the 29th of October

You’ll be hearing from me soon. In the meantime I welcome anyone that wants to participate. Just leave a comment on this post, with your details. If it proves to be popular then I’ll get some kind of signup/participant website going.