Try the Ajax api_ application techniques of Google search

Source: Internet
Author: User
The last two months to visit Google's old ventilation, also 8 know what the great gfw made of what means. Although the form is not optimistic, still see the dog released Google AdSense API and Google search Ajax API, the latter is obviously more practical value. So I used the potential of the swift theft of the manual API key, in reference to the online after, or use the actual code to speak it:
Copy Code code as follows:

function OnLoad () {
Create a Search control
var SearchControl = new Gsearchcontrol ();

Search options, set here to automatically expand
var options = new Gsearcheroptions ();
Options.setexpandmode (Gsearchcontrol.expand_mode_open);

Added a web search
Searchcontrol.addsearcher (New Gwebsearch (), options);

Search results Output options, List display gsearchcontrol.draw_mode_tabed is another option, tab shows various search results
var drawoptions = new Gdrawoptions ();
Drawoptions.setdrawmode (gsearchcontrol.draw_mode_linear);

Show 8 results at a time
Searchcontrol.setresultsetsize (Gsearch.large_resultset);
Tell the searcher to draw itself and tell it where to attach
Searchcontrol.draw (document.getElementById ("SearchControl"), drawoptions);

Start Search
Searchcontrol.execute ("Google");
}

The current version of the API is 0.1, after the release of the official version 1.0, the search results will be advertising, apparently the lunch is not free.

    • Here I wrote the demo (if not access, indicating that Google began to exhaust the)-http://www.ooso.net/temp/demo/search.html
    • Google AJAX Search API Example
http://code.google.com/apis/ajaxsearch/documentation/#AdvancedSamples
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.