1async function getBanners() { 2 try { 3 const response = await fetch('https://opensheet.elk.sh/1jTJHyJHcv9pDy4c_dZMRxE34QBbmmAC6P2c0106Ba_0/adText', { 4 method: 'GET', 5 headers: { 6 accept: 'application/json', 7 }, 8 }); 9 10 if (!response.ok) { 11 throw new Error(`Error! status: ${response.status}`); 12 } 13 14 const result = await response.json(); 15 return result; 16 } catch (err) { 17 console.log(err); 18 } 19 } 20 21async function renderRandomAdText() { 22 let adtext = await getBanners(); 23 let index = Math.floor(Math.random() * adtext.length); // random banner 24 // console.log(adtext[index]); 25 let html = ''; 26 let htmlSegment = `<div 27 style="width:auto;height:auto; 28 padding-top: 5px; 29 padding-right: 15px; 30 padding-bottom: 1px; 31 padding-left: 1px;"> 32 <span>${adtext[index].adText}</span><br> 33 <span>${adtext[index].cta}</span> <a href='${adtext[index].adLink}' rel='nofollow' target="_blank"> 34 <span style="text-decoration: none;">${adtext[index].adLink}</span><svg viewBox="0 0 20 20" width="15" height="15" fill="currentColor" class="w-3 h-3"> 35 <path d="M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"></path> 36 <path d="M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"></path> 37 </svg> 38 </a></div>`; 39 40 html += htmlSegment; 41 42 //let container = document.querySelector('.adText'); 43 //container.innerHTML = html; 44 document.querySelector('#randomTextAd').innerHTML = html; 45 // <div id="randomTextAd"></div> // to display advert 46} 47 48renderRandomAdText();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.