Google API Implementation V1



 "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=" . urlencode($_POST['search']), // Normal web search
        "links" => "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=" . urlencode("link:" . $_POST['search']), // Normal web search for sites linking to us
        "site" => "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=" . urlencode("site:" . $_POST['search']), // Pages on our site indexed by Google
        "blog" => "http://ajax.googleapis.com/ajax/services/search/blogs?v=1.0&q=" . urlencode($_POST['search']) // Normal web search
    );

    $results = array();
    foreach ($searches AS $type => $url) {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_REFERER, "http://www.fliquidstudios.com/scripts/google_v1.php");
        $body = curl_exec($ch);
        curl_close($ch);
        $json = json_decode($body);
        $results[$type] = $json->responseData->cursor->estimatedResultCount;
    }
}
var_dump($results);
?>