simple google script
Platform: PHP
Published Jun 23, 2012
Updated Jun 23, 2012
Useful for example in PHP bots
<?php
// GsearchResultClass, unescapedUrl, url, visibleUrl, cacheUrl, title, titleNoFormatting, content
function gfind ($search) {
$json = json_decode(file_get_contents("http://ajax.googleapis.com/ajax/services/search/web?v=1.0&rsz=large&q=".str_replace(" ", "+", $search).""));
$answer = $json->responseData->results[0];
print_r($answer);
if ($answer->title != '') { return $answer; } else { return 0; }
}
$m = gfind("dog");
echo $m->title;
?>