<% if request.querystring="" then sendform() else sendform() ' You must ask Google for a key key = "000000000000000000000000000" ' The URL where the script is located URL = "http://www.yourdomain/yourscript.asp" SoapText = "" & key &"" & request.querystring("keywords") & "" & request.querystring("h") & "10truefalse latin1latin1" Googleurl = "http://api.google.com/search/beta2" Set objXML = CreateObject("Microsoft.XMLHTTP") objXML.open "POST",Googleurl,"False" objXML.setRequestHeader "Man", "POST"+" "+Googleurl+" HTTP/1.1" objXML.setRequestHeader "MessageType", "CALL" objXML.setRequestHeader "Content-Type", "text/xml" objXML.send SoapText ResponsePage = objXML.responseText Set objXML = Nothing ResponsePage=Replace(ResponsePage," xsi:type=" & CHR(34) & "xsd:string" & CHR(34),"") ResponsePage=Replace(ResponsePage,"<b>","") ResponsePage=Replace(ResponsePage,"</b>","") ResponsePage=Replace(ResponsePage,"<br>","
") EstimatedResults=left(ResponsePage,inStr(ResponsePage,"")-1) EstimatedResults=right(EstimatedResults,len (EstimatedResults)-inStr(EstimatedResults,"" & q & ": " & EstimatedResults & "   next 10
") public namearray namearray=split (ResponsePage,"") max=ubound(namearray)-1 for i=1 to max theurl=left(namearray(i),inStr(namearray(i),"")-1) theurl=right(theurl,len (theurl)-instr(theurl,"")-4) thetitle=left(namearray(i),inStr(namearray(i),"")-1) thetitle=right(thetitle,len (thetitle)-inStr(thetitle,"")-6) if thetitle="" then thetitle="No Title" end if AA=inStr(namearray(i),"</snippet>")-1 thedescription=left(namearray(i),AA) thedescription=right(thedescription,len (thedescription)-inStr(thedescription,"<snippet>")-8) Searchresults=Searchresults & "<p><a href=" & theurl & ">" & thetitle & "</a><br>" & thedescription & "<br><font size=2>" & theurl & "</font>" next Response.write(Searchresults) end if %> <% Sub SendForm() %> <form method=get action=<% =request.servervariables("URL") %>> Find Keywords <input type=text name=keywords size=15> <input type=hidden name=h value=0> <input type=submit value="Google Search"> </form> <% end sub%> <HR> Script provided by <A HREF=http://www.asptutorial.info>AspTutorial.info</a> </body></html>