>CLEAR >#DEFINE GOOGLEKEY "go to http://www.google.com/apis/ to get your own key" >#DEFINE GOOGLEWSDLFILE "c:\google\googlesearch.wsdl" > >LOCAL oGoogle AS Google >LOCAL loWS >loWS = NEWOBJECT("Wsclient",HOME()+"ffc\_webservices.vcx") >loWS.cWSName = "Google" >oGoogle = loWS.SetupClient(GOOGLEWSDLFILE, [GoogleSearchService], [GoogleSearchPort]) > >cQuery= "essential fox" >nStart= 0 >nMaxResults= 10 >lFilter= .F. >cRestrict= "" >lSafeSearch= .T. >cLR= "" >cIE= "latin1" >cOE= "latin1" > >* Results come in an XML object. >oResults = oGoogle.doGoogleSearch( GOOGLEKEY, cQuery, nStart, ; > nMaxResults, lFilter , cRestrict , lSafeSearch, ; > cLR, cIE, cOE ) > >* Scan XML and look for "resultElements" node. >* A better implementation will be required, but for >* demo this is OK. >IF TYPE( "oResults" ) != "O" OR ISNULL( oResults ) > ? "something went wrong" >ELSE > ? oResults.LENGTH, " results were found for [", cQuery ,"]" > ? "Results will be pasted to clipboard" > _CLIPTEXT = "" > FOR i=1 TO oResults.LENGTH > oTemp = oResults.nextnode > IF oTemp.nodename = "resultElements" > oActualResults = oTemp.childnodes > FOR j=0 TO oActualResults.LENGTH-1 > ? "==================================================" > ? "Result ", j+1 > ? oActualResults.ITEM(j).TEXT > _CLIPTEXT=_CLIPTEXT+oActualResults.ITEM(j).TEXT > ? oActualResults.ITEM(j).TEXT > NEXT > ENDIF > NEXT >ENDIF >RETURN > >* eof() > >>Tracy