views:

81

answers:

1

I'm looking for a google search module that uses the 'Google Custom Search API' so that I can pull the results and theme them on my page.

I know about the google_cse module. But that module does not let you customize the look of the results pulled because it's doing it via an iframe. What a I'm looking for is more like what you see when you go to the 'Google Custom Search API' page. You can see there that using this API you can pull the results server side and do what you need to with it.

I've been searching for hours with no luck. If it doesn't exist I'm willing to create a module, but I don't want to duplicate the effort. Does anyone know if such a module exits?

Update:


Someone already wrote a patch to the google_cse module that uses XML instead of an iframe as a third option.

http://drupal.org/node/348311

Also, it turns out that the search results can be be themed but from the google custom search dash board at http://code.google.com/apis/customsearch/docs/ui.html#results. However, the changes possible using this route are limited.

Google does offer the possibility of downloading the search results via XML. And clearly this would results in a greater control of the result content as stated below by @Mark Trapp

+1  A: 

Most (if not, a lot) of the time, 3rd party integration modules on Drupal.org are merely encapsulations of HTML/JavaScript widgets (like the iframe) provided by the third party. This is generally because Drupal, in the past, has been pretty awful at providing general-purpose APIs to hook into and display third party datasources, especially non-database datasources.

Because of this reality, you're likely not going to find a pre-built third-party module that truly integrates with an API if you haven't found one by now (I've also checked, Google CSE is it).

However, Drupal is evolving and Views 3 (now in alpha) supports non-database third-party datasources. Because it's not stable yet, there is hardly any documentation on this feature, but it might be worth looking at Apache Solr Views (which uses views to display Apache Solr results) and Extendr (which uses Views to display Flickr results) to see how a custom, Google CSE Views backend module might be constructed.

Mark Trapp

related questions