Advertisement
thimo

Read Promobanner from Spreadshop

Aug 20th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.92 KB | None | 0 0
  1. <html>
  2.  
  3. <head>
  4.   <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
  5.   <script>
  6.     jQuery(function($) {
  7.       const readPromo = (successCallback, failedCallback) => {
  8.         const asinUrl = 'https://shop.spreadshirt.de/welovetee';
  9.         if (asinUrl.length > 0) {
  10.           // Get Sales Rank
  11.           $.get(asinUrl, (res) => {
  12.             const doc = $(res);
  13.             let rank = doc.find('.sprd-promo-header');
  14.             successCallback(rank);
  15.           });
  16.         } else if (typeof failedCallback === 'function') {
  17.           failedCallback();
  18.         }
  19.       };
  20.       // Call function
  21.       readPromo(
  22.         (r) => {
  23.           if (r.length > 0) {
  24.             $('#spreadshop-promo-banner').append(`<td><div class="prdm-expandable">${r.html()}</div></td>`);
  25.           }
  26.         });
  27.     })
  28.   </script>
  29. </head>
  30.  
  31. <body>
  32.   <div id="spreadshop-promo-banner"></div>
  33. </body>
  34.  
  35. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement