Flickr, Google Maps and Classic ASP
Posted by beakersoft | Posted in Programming | Posted on 03-01-2008
0

I went on Holiday to the German Beer festival, Oktoberfest and wanted to be able to upload photos from my camera phone onto Flickr, so I can put them onto a website I run. I also wanted to put the pictures onto a Google map. There were quite a few things that would allow me to do this, but none met my criteria:
- Most of the scrips i found were PHP or .net, I needed an classic asp one
- I needed to be able to tag the GPS co-ords into a tag on the photo. My camera phone did not have GPS built in, so I wanted to add two tags to them containing the info, called geo:lat=[xxx] and geo:lon=[xxx]
So, I came up with this script, you can see it in action at http://www.oldmanales.co.uk/feat_OktoberFest07.asp
In order to use the script, you will need a couple of things:
- An account on Flickr with some pictures tagged with valid geo:lat= and geo:lon= values. These are used to display the picys on the map
- A Flickr API key (mine is in the example file but please use your own) get it at http://flickr.com/services/api/keys/apply
- A Google maps API key (again, mine is in the script but please use yours) get it at http://code.google.com/apis/maps/signup.html
- Your Flickr ID. This is not the same as your username, find it at http://idgettr.com
Once you have these, change the API key values to yours in the script, then upload it to your server. Now, call the script something like this:
FlickrTags2Google.asp?lat=11.511955&long=48.129893&tags=Oktoberfest_07&flickrID=7389734@N03
The lat and long parts of the string are where in the world the map will be placed when the pages loads, the tags are a comma separate list of tags to show on the map, in this case everything I have tagged as Oktoberfest_07. The last parameter is your flickrID.
Hopefully, when your call the page now you should get something like the screen shots below, the photos are indicated by the little camera icon, when you click on them you should get a popup preview of the image along with some info on the photo:

Download the file :FlickrTags2Google.asp
(and dont forget to rename it to a .asp extension otherwise it wont run.)
Hopefully when I get time I will document the code a bit better. If you find problems with it, or have any good ideas for enhancements let me know.

This Blog about my (mis)adventures in the IT industry. My aim is to update this blog as often as possable with any tips, news or rants I might have. You can reach me at luke@beakersoft.co.uk

