// insert your google key below (between the quotes), if you don't have one http://www.google.com/apis/ (it's free) $yourGoogleKey = "JxS2nhRQFHIEOY16KMmXKfMA1oesf7Yb"; // insert your website url below $yourWebsite = "http://barkati.net"; // SearchFeed codes below $trackID = "V4514137320"; // example: V4514137320 $pID = "46564"; // example: 46564 //---------------------------------------------------------------------------------------------- // build search query and connect to google //---------------------------------------------------------------------------------------------- require_once("nusoap.php"); if($_GET) { extract($_GET, EXTR_PREFIX_SAME, "get_"); } if($_POST) { extract($_POST, EXTR_PREFIX_SAME, "post_"); } if ($yourGoogleKey == "") { echo "You didn't insert a Google Key Yet! Get one at www.google.com/apis/ .."; break; } if ($query && $www) { $q = urldecode($query); if ($www != "true") { $q.= " site:$yourWebsite"; } if(!$start) { $start=0; } else { $start = intval($start); } $parameters = array( "key" => $yourGoogleKey, // google developer key "q" => $q, // search query "start" => $start, // result start index "maxResults" => 10, // 10 is the maximum "filter" => false, // filtering similar entries "restrict" => "", // country and topic restrictions "safeSearch" => false, // adult content filter "lr" => "", // language restrictions "ie" => "", // deprecated and ignored parameter "oe" => "" // deprecated and ignored parameter ); $soapclient = new soapclient("http://api.google.com/search/beta2"); $result = $soapclient->call("doGoogleSearch", $parameters, "urn:GoogleSearch"); $begin = $start + 1; $end = $start + $parameters["maxResults"]; $total = $result["estimatedTotalResultsCount"]; } //---------------------------------------------------------------------------------------------- // html headers, stylesheet and search form //---------------------------------------------------------------------------------------------- ?>
Web Search Results | Search Results for | showing to of results |
//----------------------------------------------------------------------------------------------
// display results table if a search has been done
//----------------------------------------------------------------------------------------------
if ($query && $www) {
echo "
| Your Site Here |