sexta-feira, outubro 20, 2006

Google Search AJAX API

Google Search AJAX API

So interessant, no?

Entretanto, ele faz buscas em três lugares diferentes. Em web sites, em blogs e em vídeos.
"Ah, mas eu quero que ele busque em apenas um! E ele faz busca pela palavra google automaticamente!"
Simples de arrancar isso:

no código que ele te passa tem isso aqui:


// Create a search control
var searchControl = new GSearchControl();

// Add in a full set of searchers
var localSearch = new GlocalSearch();
searchControl.addSearcher(localSearch);
searchControl.addSearcher(new GwebSearch());
searchControl.addSearcher(new GvideoSearch());
searchControl.addSearcher(new GblogSearch());

// Set the Local Search center point
localSearch.setCenterPoint("New York, NY");

// Tell the searcher to draw itself and tell it where to attach
searchControl.draw(document.getElementById("searchcontrol"));

// Execute an inital search
searchControl.execute("Google");


Então.
Temos os parâmtros // Create a search control
var searchControl = new GSearchControl();

// Add in a full set of searchers
var localSearch = new GlocalSearch();
searchControl.addSearcher(localSearch);
searchControl.addSearcher(new GwebSearch());
searchControl.addSearcher(new GvideoSearch());
searchControl.addSearcher(new GblogSearch());

// Set the Local Search center point
localSearch.setCenterPoint("New York, NY");

// Tell the searcher to draw itself and tell it where to attach
searchControl.draw(document.getElementById("searchcontrol"));

// Execute an inital search
searchControl.execute("Google");

Nenhum comentário: