<div id='result-container' style=' display: block; background: #000; color: rgba(255,255,255,0.9); padding: 10px 20px 10px 20px; word-wrap: break-word; border-left: 3px solid tomato; background-image: linear-gradient(to right, #000, #1E1F22);'> <img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNx_yDO4Kul-UL_G-vWpPtA-R8vYmAF3rbkhxDD51tPzBnT4Z6CW3noQzltEoaDkrcUNg5KFY4gqPjqlExoamuPCcwTFEx6GvAmbNpS1lid9graf1WCiBUpV9ZPgnmEP8waVYd27MWdUXI0JI-ssdOcOSeENDpe0BZG45chdQR7Ql-A-2IlopPJjK5jJnm/s320-rw/images.png" style="height: 150px; width: 150px; object-fit: cover;" /><h4>Finding something??</h4> <div id="result"></div> <input id='searchStr' type='text'/><br><button class='button-7' onclick='findPost();'>Search</button> </div> <script> document.querySelector('#searchStr').addEventListener('keypress', function (e) { if (e.key === 'Enter') { findPost(); } }); function findPost() { let str = document.querySelector('#searchStr').value; document.querySelector('#result').innerHTML = 'SEARCHING YOUR QUERY: \"' + str + '\"'; document.querySelector('#result').innerHTML = ''; if(document.querySelector('#authorGal')) document.querySelector('#authorGal').remove(); let numposts = 10; let authorGal = document.createElement('script'); authorGal.setAttribute('async', 'async'); authorGal.id = "authorGal"; authorGal.setAttribute('src', 'https://storehaccounts.blogspot.com/feeds/posts/default?alt=json-in-script&q=' + str + '&max-results=' + numposts + '&callback=whatshot2'); document.querySelector('head').appendChild(authorGal); } function whatshot2(json) { document.querySelector('#result').innerHTML = ''; let myfeeds = json.feed.openSearch$totalResults.$t; let length = 10; if(length > myfeeds.length) length = myfeeds; if(length == 0) document.querySelector('#result').innerHTML = 'Cant find any results...'; for(i=0; i<length; i++) { let atag = document.createElement('a'); atag.innerHTML = JSON.stringify(json.feed.entry[i].title.$t).replaceAll('"', ''); for(j=0; j<json.feed.entry[i].link.length; j++) if(json.feed.entry[i].link[j].rel == 'alternate') { atag.href = JSON.stringify(json.feed.entry[i].link[j].href).replaceAll('"',''); atag.setAttribute('target', '_blank'); atag.setAttribute('class', 'extL'); break; } document.querySelector('#result').appendChild(atag); document.querySelector('#result').innerHTML += '<br/>'; } } </script>