$hits=10; #number of results per page
///debut du script espotting
$bkfill=0; #backfill results: 0=none, 1=inktomi
$noadult=0; #adult filter: 0=off, 1=on
$affiliateId=725; #hardcoded for Coolgrafik
$url="affiliate.fr.espotting.com"; #territory
if (empty($page)) {$page=1;}
$keyword = str_replace('\"', '', $keyword); $new = fsockopen ($url, 80, $errno, $errstr, 5);
if ($new) {
$uri = str_replace(" ", "%20","/search/qsearch/results.asp?keyword=$keyword&hits=$hits&page=$page&bkfill=$bkfill&noadult=$noadult&affiliateId=$affiliateId");
fputs($new, "GET $uri HTTP/1.0\r\n\r\n");
$str = fgets($new, 4096);
$count=0;
while ((strncmp($str, 'HITS=', 5)) && (!feof($new)))
{
$str = fgets($new, 4096);
if ($count==30) break;
$count++;
}
$NumberOfResults = substr($str, 5);
$Total = substr(fgets($new, 4096), 6);
$ResponseTime = substr(fgets($new, 4096), 5);
if ($NumberOfResults>0){$HasResults = 1;} }
if ($HasResults) {
$count=0;
while (!feof($new)) {
if ($count==30) break;
$Position[$count] = substr(fgets($new, 4096), 2);
$Title[$count] = substr(fgets($new, 4096), 2);
$Description[$count] = substr(fgets($new, 4096), 2);
$ActualURL[$count] = substr(fgets($new, 4096), 2);
$tmp2 = strpos($ActualURL[$count], "&bidid");
if (!$tmp2) {$EResult[$count] = 2;}
else {$EResult[$count] = 1;}
$ShowURL[$count] = substr(fgets($new, 4096), 2);
preg_match("/^(http:\/\/)?([^\/]+)/i",
$ShowURL[$count], $matches);
$host = $matches[2];
$ShowURL[$count] = $host;
$Cost[$count] = substr(fgets($new, 4096), 2);
$ImageURL[$count] = substr(fgets($new, 4096), 2); $count++;
}
fclose($new); }
?>
$count=0?>
0)):?>
$count++;
endwhile;?>
|
Votre recherche ne retourne aucun resultat, veuillez réessayer.
|
|