Complete Guide to Google Ajax Search API

  • 1,264 views
Uploaded on

 

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
  • bullshits
    Are you sure you want to
    Your message goes here
    Be the first to like this
No Downloads

Views

Total Views
1,264
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
5
Comments
1
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Complete Guide to Google Ajax Search API Explained by Rohit Ghatol [email_address]
  • 2. Why use Google Ajax Search API?
      • Allow user to search on your site
      • Allow user to get categorized search results
      • Allow the search results to be restricted to a domian
      • Help user with recommended search key words
      • Show Video Bar, Book Bar, Blog bar and News Bar
  • 3. Getting Started
      • Get a Google Ajax Search API Key for your domain
      • Code for Categoried search results
      • Code for chaning look and feel and position of search results
      • Code for restricting Search results to a Domain
      • Code for adding Map Search, Video Search
      • How to use wizards for Book/Blog/Video/News Bar
      • How to setup a Custom Search Engine
      • Using the Custom Search Engine to refine search results
  • 4. Get the Key from this Page
  • 5. Code for Categorized Search Result GSearchControl GwebSearch div with id “searchcontrol ”
  • 6. Code for Categorized Search Result <html> <head> <script src=&quot;../../api?file=uds.js&amp;v=1.0&quot; type=&quot;text/javascript&quot;></script> <script type=&quot;text/javascript&quot;> //<![CDATA[ ...................... (see next slide) //]]> </script> </head> <body> <div id=&quot;searchcontrol&quot;>Loading</div> </body> </html>
  • 7. Code for Categorized Search Result <script type=&quot;text/javascript&quot;> //<![CDATA[ function OnLoad() { // 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()); searchControl.addSearcher(new GnewsSearch()); searchControl.addSearcher(new GimageSearch()); searchControl.addSearcher(new GbookSearch()); // Set the Local Search center point localSearch.setCenterPoint(&quot;New York, NY&quot;); // tell the searcher to draw itself and tell it where to attach searchControl.draw(document.getElementById(&quot;searchcontrol&quot;)); // execute an inital search searchControl.execute(&quot;VW GTI&quot;); } GSearch.setOnLoadCallback(OnLoad); //]]> </script>