Project Description

GSearch is a modular class library for conducting many types of Google searches from .NET 3.5 and Silverlight 2 managed code. GSearch supports blog, book, image, location, news, patent, video, and web searches, returning the results in easy-to-traverse collections. Language: C#.

Overview

Update: I've started work on version 1.2 of the GSearch libraries, which will add support for new image and web search arguments, as well as make some improvements to the code structure and bring everything into line with the current state of Google's json API. I have started a discussion topic to keep track of the work and collect any ideas GSearch users have. Please have a look and comment.

GSearch arose out of a silly idea I had for a Silverlight 2 game; just something to do for an exercise. The idea was to take search terms from the user, search Google images, and arrange the results into a memory grid. In the process of writing that game I became familiar with the Google search API, and once it was done I decided to extend the search code into a library covering the whole API. You can play the game here if you're interested, and have Silverlight 2.0 installed.

Google formerly supported a SOAP webservice which is now being somewhat deprecated in favor of the RESTful service, which returns a stream of JSON objects rather than the very verbose SOAP responses. GSearch deserializes the JSON results using DataContractJsonSerializer, which is why it is a .NET 3.5/Silverlight 2 library. You can read more about the Google API on their documentation site.

Note that there are two versions of the libraries. The default release for this project, linked at right, is the .NET 3.5 assemblies. If you want to use GSearch in a Silverlight application you'll need the GSearch.SL2 runtimes release. There is very little difference between the two libraries, but Silverlight needs to have the assemblies built against its runtime.

Architecture

In order to keep the payload at a minimum for Silverlight applications, and just provide overall flexibility, GSearch is structured as a set of small assemblies. The GSearch.Core.dll assembly implements the core search engine and does almost all of the work. It weighs in at around 21k and is needed by all applications that want to use GSearch. There are eight smaller assemblies that perform the specific search types. Their names are self-evident, i.e. GSearch.Blog.dll. All these assemblies do is implement classes that provide a strongly-typed layer over the core search methods, search arguments, and event arguments.

The classes are very simple to use. Release documentation includes a compiled class reference for the GSearch namespace, as well as a readme.txt file with basic usage examples.

Last edited Mar 3, 2010 at 3:20 AM by MarkBetz, version 5