Location: PHPKode > projects > Taxonomic Search Engine > google.php
<?php

// $Id: google.php,v 1.1.1.1 2005/05/19 10:31:10 rdmpage Exp $

require_once("config.inc.php");
require_once("lib/nusoap.php");


function GoogleSpelling ($string)
{
	global $config;
	$result = "";

	$parameters = array(
		'key' => $config['Google_key'],
		'phrase' => $string
		);

	//print_r($parameters);

	$soapclient = new soapclient('http://api.google.com/search/beta2');
	
	$proxyhost = '';
	$proxyport = '';
	if ($config['proxy_name'] != '')
	{
		$proxyhost = $config['proxy_name'];
		$proxyport = $config['proxy_port'];
	}

	$soapclient->setHTTPProxy ($proxyhost, $proxyport);
	
	$response =$soapclient->call (
		'doSpellingSuggestion' ,
		$parameters,
		'urn:GoogleSearch',
		'urn:GoogleSearchAction' );
		
		
	$result = $response;
	return $result;
}

?>
Return current item: Taxonomic Search Engine