Advertisement
Guest User

Untitled

a guest
Apr 14th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <div id="results" method="post" style="float:left;" name="results" onchange="function">
  2.        
  3. </div>
  4.  
  5. <script type="text/javascript">
  6. /* <![CDATA[ */
  7.   function _cb_findItemsByKeywords(root) {
  8.     var items = root && root.findItemsByKeywordsResponse &&
  9.       root.findItemsByKeywordsResponse[0] &&
  10.       root.findItemsByKeywordsResponse[0].searchResult &&
  11.       root.findItemsByKeywordsResponse[0].searchResult[0] &&
  12.       root.findItemsByKeywordsResponse[0].searchResult[0].item || [];
  13.      
  14.     var html = [];
  15.      
  16.     html.push('<table width="100%" border="0" cellspacing="0" cellpadding="3"><tbody>');
  17.          
  18.     for (var i = 0; i < items.length; ++i) {
  19.       var item = items[i];
  20.       var shippingInfo = item.shippingInfo && item.shippingInfo[0] || {};
  21.       var sellingStatus = item.sellingStatus && item.sellingStatus[0] || {};
  22.       var listingInfo = item.listingInfo && item.listingInfo[0] || {};
  23.       var title = item.title;  
  24.       var subtitle = item.subtitle || '';
  25.       var pic = item.galleryURL;
  26.       var viewitem = item.viewItemURL;
  27.       var currentPrice = sellingStatus.currentPrice && sellingStatus.currentPrice[0] || {};
  28.       var displayPrice = currentPrice['__value__'] + '€';
  29.       var buyItNowAvailable = listingInfo.buyItNowAvailable && listingInfo.buyItNowAvailable[0] === 'true';
  30.       var freeShipping = shippingInfo.shippingType && shippingInfo.shippingType[0] === 'Free';
  31.        
  32.       if (null !== title && null !== viewitem) {
  33.         html.push(`
  34.           <tr>
  35.             <td class="image-container">
  36.               <img src="${pic}"border = "0">
  37.             <\/td>
  38.             <td class="data-container">
  39.               <a class="item-link" href="${viewitem}" target="_blank">
  40.                 <p class="title">${title}<\/p>
  41.                 <p class="subtitle">${subtitle}<\/p>
  42.                 <p class="price">${displayPrice}<\/p>
  43.                 ${buyItNowAvailable ? '<p class="bin">Sofort Kaufen<\/p>' : ''}                  
  44.                 ${freeShipping ? '<p class="fs">Versandkostenfrei<\/p>' : ''}
  45.               <\/a>
  46.             <\/td>
  47.           <\/tr>
  48.         `);
  49.       }
  50.     }
  51.        
  52.     html.push('<\/tbody><\/table>');
  53.     document.getElementById("results").innerHTML = html.join('');      
  54.   }
  55. /*]]>*/
  56. </script>
  57. <script src=
  58. "https://svcs.ebay.com/services/search/FindingService/v1?SECURITY-APPNAME=BAFTunin-DFuchs-PRD-9796ade31-eb6822af&amp;OPERATION-NAME=findItemsByKeywords&amp;SERVICE-VERSION=1.0.0&amp;RESPONSE-DATA-FORMAT=JSON&amp;callback=_cb_findItemsByKeywords&amp;REST-PAYLOAD&amp;keywords=Alufelge%20Alfa%20Romeo%204C%20Alufelge&amp;paginationInput.entriesPerPage=8&amp;GLOBAL-ID=EBAY-DE&amp;siteid=77"></script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement