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></b> yeilded a total of <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>{</b> \t Bids: <b>{item->BidCount}</b><br>"; if (<b>{item->BINPrice}</b><br>"; } echo "Auction Start: <b>{</b> \t Auction End: <b>{item->EndTime}</b><br>"; item->EndTime); endTime - time(); //timeRemaining); echo "Time Remaining: <b></b><br>"; echo "Time Remaining: <b>" . prettyTimeRemaining(timeRemaining) ."</b><br>"; echo "<br><br>"; } if (trim(searchTerms}&page=" . (</a><br>"; } } function prettyTimeRemaining(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.