eBay Quickstart Tutorial Modified for large images


/ Published in: HTML
Save to your folder(s)

This is how you get large photos with the eBay Finding API


Copy this code and paste it in your HTML
  1. <title>eBay Search Results</title>
  2. <style type="text/css">body { font-family: arial,sans-serif;} </style>
  3. </head>
  4. <h1>eBay Search Results</h1>
  5. <div id="results"></div>
  6.  
  7. function _cb_findItemsByKeywords(root)
  8. {
  9. var items = root.findItemsByKeywordsResponse[0].searchResult[0].item || [];
  10. var html = [];
  11. html.push('<table width="100%" border="0" cellspacing="0" cellpadding="3"><tbody>');
  12.  
  13. for (var i = 0; i < items.length; ++i)
  14. {
  15. var item = items[i];
  16. var title = item.title;
  17. var pic = item.pictureURLSuperSize;
  18. var viewitem = item.viewItemURL;
  19.  
  20. if (null != title && null != viewitem)
  21. {
  22. html.push('<tr><td>' + '<img src="' + pic + '" border="0">' + '</td>' +
  23. '<td><a href="' + viewitem + '" target="_blank">' + title + '</a></td></tr>');
  24. }
  25. }
  26. html.push('</tbody></table>');
  27. document.getElementById("results").innerHTML = html.join("");
  28. }
  29.  
  30. <!--
  31. Use the value of your appid for the appid parameter below.
  32. -->
  33. <script src=http://svcs.ebay.com/services/search/FindingService/v1?SECURITY-APPNAME=carson2e7-8d18-4e3b-8267-5a37144ec50&OPERATION-NAME=findItemsByKeywords&SERVICE-VERSION=1.13.0&RESPONSE-DATA-FORMAT=JSON&callback=_cb_findItemsByKeywords&REST-PAYLOAD&keywords=iphone%6&paginationInput.entriesPerPage=3&outputSelector=PictureURLSuperSize>
  34. </body>
  35. </html>​

URL: jonah.net

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.