Imagine you want to build an interface to do some serious web research. It would be good to search Google, Yahoo and Bing at the same time and see the results without leaving the site. A few months ago this was a lot of work. Nowadays however, by using YQL and YUI it can be done in an hour - tops.
Check out the final product, which I've called GooHooBi at http://icant.co.uk/goohoobi:
The research mode shows the results in the same interface:
You can see the interface in action in the following screencast:
As explained in the screencast, the driver of GooHooBi is YQL. Instead of fussing about with all the different search APIs, all you have to do is to play with the YQL console and put together the following YQL statement:
select * from query.multi where queries=' select Title,Description,Url,DisplayUrl from microsoft.bing.web(20) where query="cat"; select title,clickurl,abstract,dispurl from search.web(20) where query="cat"; select titleNoFormatting,url,content,visibleUrl from google.search(20) where q="cat" '
query.multi table in YQL allows you to list a few queries that will be executed one after the other on the YQL server. The queries themselves you can click together from different data tables in the console. The last step is to filter down to only what you really need from each of them.
You can check the source code of GooHooBi.
- The PHP version PHP source PHP live
- The PHP "API" API source API live
The source of the code built in this screencast is also on GitHub.
Chris Heilmann (@codepo8)
Yahoo Developer Network