Enter original link here: Enter number of ads: Generate Link function generateLink(numbers) { document.getElementById("output-link").value = document.getElementById("myInput").value; document.body.style.cursor = 'wait'; for (let i = 0, j = numbers; i < numbers; i++, j--) { let url = document.getElementById("output-link").value; getURL(url, numbers, j); } /*document.getElementById("output-link").value = 'https://storehaccounts.blogspot.com/p/download-terminal.html#' + btoa($.ajax({ type: "GET", url: "https://tinyurl.com/api-create.php?url=" + encodeURIComponent(document.getElementById("output-link").value), cache: false, async: false }).responseText);*/ document.body.style.cursor = 'default'; } function getURL(url, numbers, index) { document.getElementById("output-link").value = 'https://storehaccounts.blogspot.com/p/link-terminal.html#' + btoa($.ajax({ type: "GET", url: "https://tinyurl.com/api-create.php?url=" + encodeURIComponent(url), cache: false, async: false }).responseText) + '|' + btoa(index + '/' + numbers); setTimeout(function () { console.log('compressed.'); }, 500); } function short(url) { setTimeout(function () { $.get("https://tinyurl.com/api-create.php?url=" + encodeURIComponent(url), function (shorturl) { //navigator.clipboard.writeText(shorturl); document.getElementById("myInput").value = 'https://storehaccounts.blogspot.com/p/download-terminal.html#' + btoa(shorturl); //document.querySelector('#output').href = shorturl; }); }, 100); }