10 August 2006

Made a first Google Gadget for Space Browse

Just a brief note to say that I managed to make a Google gadget very quickly for my Space Browse virtual tour site. Having read quickly through the Google Gadget starter documentation earlier in the day, it only took an hour or so to make a gadget that shows a random virtual tour.

I had to make a new web form page that used a new stored procedure to get a random publicly accessible photo-site. Thanks to whoever it was who had the tip that adding ORDER BY NEWID() gives a random result set for a SELECT statement. This works by generating a new uniqueidentifier/guid for each result row; because the Guids are random, ordering on this will return a randomly sorted result set. I added TOP 1 because I only wanted one random result.

The gadget found a bug in my existing code that assumed that something divided by something else was an integer. I fixed it by using Math.floor().

The gadget is still basic because it does not respond to the provided width. It also needs to remove some of its borders.

Anyway, here's the gadget:
Add to Google

No comments: