HW 1 Query 2 .
This page will implement the following websql query:
select d1.url,d1.title from document d1 such that d1 mentions umr;

The program will return the first 10 results. It uses php nuSOAP to call Google Web API.


;


'm0nmJOdQFHLqAyh+2I5xIYzZ2f3kyFPg', 'q'=>$content, #query here 'start'=>'0', 'maxResults'=>'10', 'filter'=>'false', 'restrict'=>'', 'safeSearch'=>'false', 'lr'=>'', 'ie'=>'latin', 'oe'=>'latin' ); #Create a new soap client, feeding it to GoogleSearch.wsdl on Google's site $soapclient = new soapclient('http://api.google.com/GoogleSearch.wsdl','wsdl'); #query Google $results = $soapclient->call('doGoogleSearch',$parameters); #print_r($results); #print results if (is_array($results['resultElements'])) { print "

The google query for '".$parameters['q']."' found ". $results['estimatedTotalResultsCount']." results, the top ten results are:

"; foreach ($results['resultElements'] as $result) { print "URL : "; print "".$result['URL'].""; print "
"; print "Title : "; print "".$result['title'].""; print "
===========================================================================
"; } }; } ?>