GOOGLE API 学习

学习途径

访问:http://code.google.com/intl/zh-CN/

 

 

申请地址:https://www.google.com/accounts/NewAccount

获取API key:http://code.google.com/intl/zh-CN/apis/loader/signup.html

这里需要一个网址,就是你API应用的网址!

我的网址当然就是:http://www.cnblogs.com/zjfree

我的API key:ABQIAAAAWUT8aaIj9mtqQa087LjVOhTPB5B7LRDljl2Cr4-JwBNft1mFrRRmR1RoYEUCZCj0dtS2gIc8Al4-VA

API列表:http://code.google.com/intl/zh-CN/more/

做完上面步驟就可以開始學習了

一下是我产生的KEY以及使用方法

Your key is:

ABQIAAAA90WktTzSw1WAxPBzty8RThS8AgFq3w7AIsGXYqeUdiJ_xgRCsBTYp3xh5CGG_jkAjWj4dud6MSAEaw

This key is good for all URLs in this directory:

http://www.cnblogs.com/ivanyb

Here is an example web page to get you started:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>My Google API Application</title>
    <script src="https://www.google.com/jsapi?key=ABQIAAAA90WktTzSw1WAxPBzty8RThS8AgFq3w7AIsGXYqeUdiJ_xgRCsBTYp3xh5CGG_jkAjWj4dud6MSAEaw" type="text/javascript"></script>
    <script language="Javascript" type="text/javascript">
    //<![CDATA[

    google.load("search", "1");

    function OnLoad() {
      // Create a search control
      var searchControl = new google.search.SearchControl();

      // Add in a full set of searchers
      var localSearch = new google.search.LocalSearch();
      searchControl.addSearcher(localSearch);
      searchControl.addSearcher(new google.search.WebSearch());
      searchControl.addSearcher(new google.search.VideoSearch());
      searchControl.addSearcher(new google.search.BlogSearch());

      // 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");
    }
    google.setOnLoadCallback(OnLoad);

    //]]>
    </script>
  </head>
  <body>
    <div id="searchcontrol">Loading...</div>
  </body>
</html>

 

posted @ 2010-11-18 10:30  ZYB  阅读(385)  评论(0编辑  收藏  举报