Searching is fine… let’s make it easier, or even fun!
Getting Images from Live Search APIs – part 1
I don’t like the snow.
When it is fresh, it is white and beautiful, but it is way too cold…
Then, if you live in a city, it quickly gets dirty and muddy…
And, we had plenty this year in Seattle, especially around Christmas.
So, I’d rather stay home when it snows, enjoying the family and,
if possible, doing something cool… whatever happens to be cool for me at the time.
This time, I ended up doing some work for my little web site for fishing aficionados. A web I use more as a web developer fitness center than a real web app… right! go figure… :-)
Since I reviewed Microsoft’s Live Search APIs 2.0, a few days before the Christmas break, I thought it would be interesting to include some of the content they make available, like search results, news and images on my web’s pages.
Boy, these APIs make accessing Microsoft Live Search really easy!
You compose a query in a search request and you get a collection of results back. Both request and results are typed, i.e. images and news have different types, with specific properties, etc.. And, you can use different protocols, such as SOAP, XML, to communicate with the Live Search API service.
Building an application around them is quite simple. So, developers can really focus on how to implement the user scenarios.
For my web, I thought it would be cool to have an image slideshow, showing fishing photographs taken from those indexed on the net, within the context imposed by any given container page, yet picked in a somewhat random way and always fresh (making sure to properly show their source/credits).
I started envisioning something like this… Great fish, by the way!

So, let’s see… what are we looking at here?
A custom ASP.NET server control, a composite one, with an Ajax slide show extender to animate the images and interact with the user through the buttons… and some code to connect to the Microsoft Live Search service.
Yes, that would do it.
As a second thought, I would need to expose the application ID on the client Javascript code, hmmm… not good… not good!
It is not that the AppID could not be sniffed on the net, but the idea of plainly exposing it, didn’t sound right.
More importantly, if my web had many users that would translate in many requests to Microsoft Live Search API, one per active client.
Yet… if two or more clients were looking at the same page – say the one about Alaska, i.e. issuing the same query (like: “Fishing Alaska”), wouldn’t I be able to cache the request/content on my web, before serving that page?
Gotcha!!
I just needed a service on my web, to support client requests and forward them to the Microsoft Live Search APIs and/or cache them and their results.
Perhaps two, three days of work for a solid prototype…
Sure! Why not?
After all, there were two feet of snow outside…
And so I did… and it was almost like I predicted.
The architecture it is working fine, and the results are neat.
Plus, I managed to create another couple of interesting components on the way…
And now that the snow melt for long, I thought I would share this experience with you. That is.
Stay tuned for the incoming parts…