예제 #1
0
        $queryBox = '<input class="input-large search-query" name="query" type="text" size="60" maxlength="60" value="" />';
        $newQueryBox = '<input class="input-large search-query" name="query" type="text" size="60" maxlength="60" value="' . $query . '" />';
        $contents = str_replace($queryBox, $newQueryBox, $contents);
        //we will also replace the code that places the search box with a box containing the new query string.....
        $contents = str_replace('<div class="span4" id="divCheckboxBing" style="display: none;"></div>
	 <div class="span4" id="divCheckboxBlekko" style="display: none;"></div>
        <div class="span4" id="divCheckboxGoogle" style="display: none;"></div>', $rewriteResultStr, $contents);
    }
    $query = urlencode("'{$query}'");
    //we can alter these as they no longer need to get passed to the search engines
    $bingResultStr = '';
    $googleResultStr = '';
    $blekkoResultStr = '';
    //do our searches
    $bingResultArray = searchBing($query, $numResults);
    $blekkoResultArray = searchBlekko($query, $numResults);
    $googleResultArray = searchGoogle($query, $numResults);
}
//display our results by search engine
if ($outputType == 1) {
    $bingResultStr = '';
    $googleResultStr = '';
    $blekkoResultStr = '';
    $arrSize = sizeof($bingResultArray);
    $bingResultStr .= '<div class="span4" style="padding:4px 4px"><h3>Bing</h3>';
    for ($i = 0; $i < $arrSize; $i++) {
        $bingResultStr .= '<p><a href="http://';
        $bingResultStr .= $bingResultArray[$i][0];
        $bingResultStr .= '" >';
        //make sure the link doesn't bleed when displayed
        if (strlen($bingResultArray[$i][7]) > 40) {
예제 #2
0
             }
         }
     } else {
         if ($radioGroup2 == 'stemmingOn') {
             // Remove stopwords and apply stemming
             $stemsUnique = applyPorterStemming($searchExploded);
             $search = implode(" ", $stemsUnique);
             $bing = searchBing($search);
             if ($bing == false) {
                 $bingresults = "Sorry, no results matching {$search}";
             }
             $entireWeb = searchEntireWeb($search);
             if ($entireWeb == false) {
                 $entireWebresults = "Sorry, no results matching {$search}";
             }
             $blekko = searchBlekko($search);
             if ($blekko == false) {
                 $blekkoresults = "Sorry, no results matching {$search}";
             }
             $google = scrapeGoogle(urlencode($search));
             if ($google == false) {
                 $googleresults = "Sorry, no results matching {$search}";
             }
         }
     }
 }
 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 /** 
  * For evaluation only: to get MAP!
  */
 /*