Photo from Chile

cfTwitMap - A ColdFusion-Driven Twitter Google Maps Mashup

Map Your Friends

More info on this utility can be found below, but to give it a try just enter your Twitter screen name below and click Map My Friends!

About the Utility

Back in May of 2009, after using Twitter actively for around a year, I had an inkling that a disproportionate percentage of my friends were from the UK. I cannot say exactly why I thought this, but I wanted to find out if it was true, so I did some Googling to see if there were any sites that would map your friends for you. I didn't come up with anything, so I decided to build something myself.

Thanks to the availability of APIs for Twitter and Google Geocode and Maps, and open source projects like Pedro Claudio's ColdFusion Twitter Lib and Ray Camden's Google Geocode, as well as the Google Maps API Utility Library, I was able to bash something together in no time at all.

I'm using those libraries with a bit of ColdFusion and JavaScript code to create a little app that will show you where in the world all of your friends are. Specifically, I'm using Twitter's API to get a list of your friends, and then use Google's Geocode API to find the coordinates of their location (from their Twitter profile). I then create a Google Map via the JavaScript API, center the map at your location, and use the MarkerClusterer feature of the Google Maps API Utility Library to add a marker for each friend whose location could be determined. This allows the markers to appear as a cluster when zoomed out. As you zoom in you'll see each individual marker, at which point you can hover over it to see the person's screen name, and you'll also see their latest tweet in a popup balloon.

There is an issue with asking Google for location information via the Geocode API so I had to intentionally slow down the messages that were being sent to it. That's why the process takes so dang long. There is a pretty status bar, done using the jQuery UI project's Progressbar widget. At the end of the lengthy process you'll see a map, as well as an ugly report showing exactly what happened when Google was asked for your friends' addresses.

This whole thing was written nearly a year ago, and I'm just now skinning it to fit in with my blog. It's certainly not perfect, bit it's still pretty cool.