web 2.0

Silverlight Application: Google Search (updated)

This application uses Google Search API and behaves like Internet Search Application with option to preview desired page in web browser directly in this application.

Layout

Layout

Out of Browser

Out of Browser

Installation

Installation


Read more to get know how I built it and download the source code.
Update: The project was published on CodePlex: slgooglesearch.codeplex.com

A lot of famous social webs, applications or search engines enable developers to use their API for some general functionality. Mostly, it is done by REST or SOAP API with response in REST/SOAP xml or JSON. It is not a big deal to find API services of the most popular web applications: Facebook API, Flick API, Twitter API, Google Search API.

I tried to experiment with the Google Search API for non-javascript environments. It accepts requests via RESTful interface and returns results via JSON.

You have to encode your search request in this way:
http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=Silverlight&rsz=large&start=10
It means to search for Silverlight, return 8 results (large result size), start with result at index 10.

I built a simple silverlight client, that makes requests to this service by WebClient(class), convert the JSON result to an XML and then parse it to a collection of GoogleSearchResult(class) objects shown in ItemsControl.

I tested the new WebBrowser control in which, you can preview desired search result. Because it works only in Out of Browser mode I practiced utilization of InstallState and IsRunningOutOfBrowser properties to provide install button and determine whether application runs OoB or not.

CodePlex

CodePlex

Download and look at the source code it you would like to see my implementation of using Google Search API in Silverlight client.

I published the source code of this project at CodePlex: slgooglesearch.codeplex.com.

One Response to “Silverlight Application: Google Search (updated)”

  1. [...] Via http://bachelorthesis.zdechovan.com/silverlight-application-google-search/ [...]