I'm clearing out my code cupboard and will begin with this simple little php kelkoo keyword search snippet. Useful for price comparison, or adding some products to a page.
Results for this bit of code here Kelkoo Search for L64840L Washing MachinePHP Code:<?php
function UrlSigner($urlDomain, $urlPath, $partner, $key){
settype($urlDomain, 'String');
settype($urlPath, 'String');
settype($partner, 'String');
settype($key, 'String');
$URL_sig = "hash";
$URL_ts = "timestamp";
$URL_partner = "aid";
$URLreturn = "";
$URLtmp = "";
$s = "";
$time = time();
$urlPath = str_replace(" ", "+", $urlPath);
$URLtmp = $urlPath . "&" . $URL_partner . "=" . $partner . "&" . $URL_ts . "=" . $time;
$s = $urlPath . "&" . $URL_partner . "=" . $partner . "&" . $URL_ts . "=" . $time . $key;
$tokken = "";
$tokken = base64_encode(pack('H*', md5($s)));
$tokken = str_replace(array("+", "/", "="), array(".", "_", "-"), $tokken);
$URLreturn = $urlDomain . $URLtmp . "&" . $URL_sig . "=" . $tokken;
return $URLreturn;
}
$kelkooquery = 'L64840L Washing Machine';
$affiliateid = 'YOURDEVELOPERID';
$trackingid = 'YOURTRACKINGID';
$krequest = UrlSigner('http://uk.shoppingapis.kelkoo.com', '/V3/productSearch?query='.urlencode($kelkooquery).'&sort=default_ranking&start=1&results=10&show_products=1&price_min=1&logicalType=and&show_subcategories=0&show_refinements=0', $trackingid, $affiliateid);
$theresult = simplexml_load_file($krequest);
foreach ($theresult->Products->Product as $theproduct) {
$productname = $theproduct->Offer->Title;
$productdescription = $theproduct->Offer->Description;
$smallimage = $theproduct->Offer->Images->Image->Url;
$bigimage = $theproduct->Offer->Images->ZoomImage->Url;
$price = $theproduct->Offer->Price->Price;
$deeplink = $theproduct->Offer->Url;
$kelkoocontent .= '<a href="'.$deeplink.'" target="_blank" rel="nofollow"><img src="'.$smallimage.'" width="90" height="90" style="float:left;border:1px solid #e4e4e4;margin:6px;" /></a><h4>'.$productname.'</h4><p>'.$productdescription.'... <strong>£'.number_format($price,2,'.',',').'</strong> <a href="'.$deeplink.'" target="_blank" rel="nofollow">Click Here</a><hr size="1" style="clear:both;" />';
}
echo $kelkoocontent;
?>
Enjoy![]()
The trouble with the rat race is that even if you win you're still a rat.
Time passes. Listen. Time passes. Dylan Thomas
Ebay Alerts to your inbox
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks