Tema: google bot
Ver Mensaje Individual
  #10 (permalink)  
Antiguo 07/10/2008, 15:53
razer
 
Fecha de Ingreso: marzo-2008
Mensajes: 237
Antigüedad: 16 años, 8 meses
Puntos: 6
Respuesta: google bot

Una persona pregunto lo mismo que yo:
http://groups.google.com.pr/group/Go...04b548dc3d953f

Probe el codigo que le pasaron, que supuestamente muestra hasta 32 resultados y esta todo customizable (creo, segun entendi), pero se queda en el Loading...

Código:
<!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" xmlns:v="urn:schemas-
microsoft-com:vml">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>Print Search Results</title>

  <!-- google search api -->
  <script src="http://www.google.com/uds/api?
file=uds.js&v=1.0&key=internal-solution" type="text/javascript"></
script>

  <!-- std apis -->
  <script src="http://www.google.com/uds/solutions/cscintro/stdlib.js"
type="text/javascript"></script>
        <link href="http://www.google.com/uds/solutions/cscintro/stdlib.css"
rel="stylesheet" type="text/css"/>

  <!-- base-styles for my demos -->
  <link href="base-styles.css" rel="stylesheet" type="text/css"/>

  <!-- main -->
  <script type="text/javascript">
    var gLog;
    var gSearch;

    function main() {
      gLog = new StdLog(document.getElementById("log"), "stdout");
      gSearch = new GwebSearch();
      gSearch.setResultSetSize(GSearch.LARGE_RESULTSET);
      gSearch.setSearchCompleteCallback(null, searchComplete, [null]);
    }

    function startSearch() {
      var input = document.getElementById("input");
      if (input.value) {
        gLog.printLine("Search Results for: " + input.value);
        gSearch.execute(input.value);
      } else {
        gLog.printLine("*** Error. Enter a Search Term ***");
      }
    }

    function methodClosure(object, method, opt_argArray) {
      return function() {
        return method.apply(object, opt_argArray);
      }
    }

    function searchComplete() {
                        gLog.clear();
      if (gSearch.results && gSearch.results.length) {
        var i;
        for (i=0; i < gSearch.results.length; i++ ) {
          var result = gSearch.results[i];
          gLog.printLine("Found: " + gSearch.results.length +
"matching results");
          gLog.printLine(result.title + " @ " + result.url);
        }
        gLog.printLine("");
      } else {
        gLog.printLine("*** Error. No Search Results ***");
      }

                        document.getElementById("cursor").innerHTML = '';
                        if (gSearch.cursor) {
        var cursorNode = createDiv(null, "gsc-cursor");
        for (var i=0; i<gSearch.cursor.pages.length; i++) {
          var className = "gsc-cursor-page";
          if (i == gSearch.cursor.currentPageIndex) {
            className = className + " gsc-cursor-current-page";
          }
          var pageNode = createDiv(gSearch.cursor.pages[i].label,
className);
          pageNode.onclick = methodClosure(gSearch, gotoPage,
                                           [gSearch, i]);
          cursorNode.appendChild(pageNode);
        }
        document.getElementById("cursor").appendChild(cursorNode);
        var more = createLink(gSearch.cursor.moreResultsUrl,
                              GSearch.strings["more-results"] +
"&nbsp;&raquo;",
                              GSearch.LINK_TARGET_SELF,
                              "gsc-trailing-more-results");
        document.getElementById("cursor").appendChild(more);
      }
    }

    function createLink(href, opt_text, opt_target, opt_className,
opt_divwrap) {
      var el = document.createElement("a");
      el.href = href;
      if (opt_text) {
        el.innerHTML = opt_text;
      }
      if (opt_className) {
        el.className = opt_className;
      }
      if (opt_target) {
        el.target = opt_target;
      }
      if (opt_divwrap) {
        var div = this.createDiv(null, opt_className);
        div.appendChild(el);
        el = div;
      }
      return el;
    }

    function gotoPage(searcher, page) {
      searcher.gotoPage(page);
    }

    function createDiv(opt_text, opt_className) {
      var el = document.createElement("div");
      if (opt_text) {
        el.innerHTML = opt_text;
      }
      if (opt_className) { el.className = opt_className; }
      return el;
    }
  </script>
</head>
<body onload="main()">
  <h1>Print Search Results</h1>
  <div class="input-box">

    <input type="text" id="input"/> <input type="button"
value="search" onclick="startSearch()"/>
  </div>
  <div id="log">Loading...</div>
        <div id="cursor"></div>
</body>
</html>
(y ya probe poniendo mi key)