Google and Dojo, Sitting in a tree…
Posted by Shane O'Sullivan on May 1, 2008
Update: I’ve also submitted a store to read any Atom or RSS feed, anywhere, without any server redirects. See Google And Dojo, F.E.E.D.I.N.G
This is different from putting a search box on your site and redirecting to Google. With the new dojox.data.GoogleSearchStore family of data stores, you can retrieve google search results in JSON format, and display them on your site directly.
Pause a second…. let it sink in…..
<div dojoType=”dojox.data.GoogleWebSearchStore” jsID=”googleStore”></div>
and you have Google’s millions of servers at your fingertips.
The following data stores are available:
- GoogleWebSearchStore - does a standard web search.
- GoogleBlogSearchStore - searches blogs. A future enhancement I will be writing will be to write a data store that accesses Google’s extremely cool Ajax Feed API, which provides access to any ATOM feed, anywhere, in JSON. It’ll be possible to do a full web search of all blogs for certain topics, then using the feed store to pull down that complete feed .
- GoogleLocalSearchStore - searches the Google Local service to find places, businesses etc.
- GoogleVideoSearchStore - Does what it says on the tin, searches for videos.
- GoogleNewsSearchStore - Finds news stories…. noticing a pattern yet?
- GoogleBookSearchStore - Um, finds books..
- GoogleImageSearchStore - Finds images. This provides both a thumbnail and full sized version, similar to the FlickrRestStore already provided by Dojo.
The potential applications are more or less infinite. Demos included in the check-in show how to integrate this with the extremely cool dojox.dtl templating engine to display the results in a number of different ways, as well as how to feed the results into the Dojo Grid, Gallery and SlideShow.
Have a look at the simplistic demo of it in action at
(available from the May 1st nightlies).
A big thank you to Google for making this service available. Now go play!
P.S. Stay tuned for the Yahoo variant, coming soon!