SOS

Shane O'Sullivan's technical blog… really ties the room together

Google and Dojo, Sitting in a tree…

Posted by Shane O'Sullivan on May 1, 2008

I’ve submitted a bunch of new data stores to the Dojo Ajax Toolkit that make it simple to search Google directly from your own site (ticket here).

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…..

There are no cross domain issues, and no server side component is required. It uses the dojo.io.script transport to access the Google Ajax API service. Just stick the following on your page:

<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.

This code is included in the nightly checkouts of Dojo, and not in v1.1. To get it, either check it out from source control, or get it from http://archive.dojotoolkit.org/nightly/.

Have a look at the simplistic demo of it in action at http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/data/demos/demo_GoogleSearchStore.html (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!

About these ads

11 Responses to “Google and Dojo, Sitting in a tree…”

  1. So. Freaking. Cool.

    Nice work!

  2. Thanks Alex :-)

  3. Bob said

    Cool, but Google Feed Ajax API Data Store shoule be more useful. Can not wait for it..

  4. It’s coming!

  5. Really useful! Well done

  6. Thanks Jose!

  7. [...] Posts Google and Dojo, Sitting in a tree…Introducing the new Dojo Image WidgetsDojo Ajax Demo Engine releasedSexy new Calendar widget for [...]

  8. Will said

    I can’t wait to try hooking it up to a dijit.form.FilteringSelect widget.

  9. Bob, The feed store is in – http://shaneosullivan.wordpress.com/2008/05/06/google-and-dojo-feeding/

    Shane

  10. [...] componentsFlickr and Dojo Image GalleryWriting a Django Template Widget With Dojo Data StoresGoogle and Dojo, Sitting in a tree…Google and Dojo, [...]

  11. Even though basic approach could be the exact same
    this variations within the guidelines influence an individual technique and they are vital that you look at
    prior to actively playing the overall game. Pontoon boat will be tinkered
    with ten 52-card decks and also the credit cards are highly valued the same as within blackjack along with picture
    greeting cards valued from 15 and also aces just one or maybe 11.

    There may be Extra with the Thirty days area which contains regular monthly number of
    the website that has a excellent information connected with online organization

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

Join 533 other followers

%d bloggers like this: