-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscript.js
26 lines (23 loc) · 1.33 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
let currentURL = "";
function generate(){
const url = document.getElementById("link").value;
const step1 = btoa(url);
let step2 = [];
for (const letter of step1.split("")) {
for (let i = 0; i < 4; i++) {
step2.push(letter)
}
}
const finalUrl = btoa(step2.join(""));
currentURL = "https://very-very-very-very-very-very-very-very-very-long-link.make-my-link-longer.xyz/this/link/is/really/quite/long/its-actually-quite-impressive/the-sheer-length-of-this-link/?longLink=true&areYouReallySurprised=iThoughtNot&whyAreYouRunning=idk&thisIsAVeryLongLink=" + encodeURIComponent(finalUrl) + "&explanation=none&context=0&utm_source=facebook&utm_medium=main&utm_campaign=THIS_TOTALLY_UNOBTRUSIVE_CAMPAIGN_NAME&utm_content=some_sad_place_on_the_internet&more_ridiculous_things_in_your_links=because_why_not&maybe_we_can=write_poetry_in_utm_links&utm_utm_utm_utm_utm_param=bye&oh_and_dont_forget_the_facebook_click_id=thanks";
document.getElementById("generated").style.display = "block";
document.getElementById("output").innerText = currentURL;
}
function copyLink() {
navigator.clipboard.writeText(currentURL);
alert("Copied to clipboard!");
}
document.addEventListener("DOMContentLoaded", () => {
document.getElementById("generate").addEventListener("click", generate);
document.getElementById("copy").addEventListener("click", copyLink);
});