topical media & game development
server-webapi-code-09-quickSearch.php / php
<html>
<head>
<title>eBay Quick Search REST API</title>
</head>
<body>
<form method="get">
Search Terms: <input type="text" name="search"><br>
<input type="submit">
</form>
<pre>
<?php
requestToken = "oVAr7OhSbdw%3D**%2Bs1d4ta8quAac9G3rvTuhs8IPvg%3D";
resultsPerPage = 10;
if (isset(_GET['page']) && ctype_digit(page = page = 0;
}
page * searchTerms = urlencode(fullEndPoint = requestToken}&RequestUserId={searchTerms}&CallName=GetSearchResults&MaxResults=skip}";
fullEndPoint);
results);
echo "Your search for <b>xml->Search->GrandTotal}</b> results<br>";
echo "These are results <b>" . (resultsPerPage + 1) . "</b> to <b>" . ((1 + resultsPerPage) . "</b><br><br>";
foreach(item)
{
item->Link;
link);
echo "<a href=\"item->Title}</a><br>";
echo "Current Price: <b>{item->BidCount}</b><br>";
if (item->BINPrice}</b><br>";
}
echo "Auction Start: <b>{item->EndTime}</b><br>";
item->EndTime);
endTime - time();
//timeRemaining);
echo "Time Remaining: <b>timeRemaining) ."</b><br>";
echo "<br><br>";
}
if (trim(searchTerms}&page=" . (timestamp)
{
weeks = floor(timestamp = weeks * 604800);
if (timeRemaining .= "days = floor(timestamp = days * 86400);
if (timeRemaining .= "hours = floor(timestamp = hours * 3600);
if (timeRemaining .= "minutes = floor(timestamp = minutes * 60);
if (timeRemaining .= "seconds = teimRemaining .= "timeRemaining;
}
?>
</pre>
</body>
</html>
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.