home *** CD-ROM | disk | FTP | other *** search
- <HTML>
- <HEAD><TITLE>Sambar Server SOAP Control Panel</TITLE>
- <%
- #include "../header.asp"
- #include "../menu.asp"
- area = "google";
- #include "submenu.asp"
- %>
- <BR>
- <BLOCKQUOTE><BLOCKQUOTE>
- <FORM method=get action=google.asp>
- <table border=0 cellspacing=4>
- <tr><td>Google Key</td>
- <td><INPUT NAME=key size=40 VALUE="<%=findParameter($params, "key", ""); %>"></td></tr>
- <tr><td>Query</td>
- <td><INPUT NAME=query size=40 VALUE="<%=findParameter($params, "query", ""); %>"></td>
- </tr>
- <tr><td></td>
- <td><INPUT TYPE=submit VALUE="Google Search"></td></tr>
- </tr>
- </table>
- </FORM>
- <BR>
- <%
- key = getParameter($params, "key");
- query = getParameter($params, "query");
- if ((key != NULL) && (query != NULL))
- {
- /*
- ** query Google using their SOAP interface
- */
- $soap = soapService("http://api.google.com/search/beta2",
- "doGoogleSearch", "GoogleSearch");
- soapPropertySet($soap, "action", "urn:GoogleSearchAction");
- soapParameterAdd($soap, "key", key);
- soapParameterAdd($soap, "q", query);
- soapParameterAdd($soap, "start", 0);
- soapParameterAdd($soap, "maxResults", 10);
- soapParameterAdd($soap, "filter", (boolean)1);
- soapParameterAdd($soap, "restrict", "");
- soapParameterAdd($soap, "safeSearch", (boolean)0);
- soapParameterAdd($soap, "lr", "");
- soapParameterAdd($soap, "ie", "latin1");
- soapParameterAdd($soap, "oe", "latin1");
-
- /* Google failed to implement chunking from the HTTP/1.1 spec. */
- soapPropertySet($soap, "chunk", "false");
- soapCall($soap);
-
- int time = soapPropertyGet($soap, "msec");
- val = soapResultGet($soap, NULL);
- if (val == NULL)
- printf("doGoogleSearch SUCCESS %d msec\n", time);
- else
- printf("doGoogleSearch FAILURE %d msec\n", time);
-
- soapServiceFree($soap);
- }
-
- %>
- <BR>
- Note: In order to use the Google Web APIs you must first register
- with Google to recieve an authentication key. You can do this online
- at <A HREF="http://www.google.com/apis/">http://www.google.com/apis/</A>.
- <BR>
- Your key will have a limit on the number of requests a data that you
- can make. The default limit is 1000 queries per day.
- </BLOCKQUOTE></BLOCKQUOTE>
- <%
- #include "../footer.asp"
- %>
- </BODY></HTML>
-