<!
DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pro Shortner</title>
<style>
body {
background-image: url("https://wallpapercave.com/wp/wp3471926.jpg");
background-repeat: no-repeat;
background-position: center;
background-size: 300%;
animation: slide-background 0.1s linear infinite;
h1 {
color: #bcff05; /* set the title color */
text-align: center;
margin-top: 50px;
font-size: 70px;
label {
color: #00f7ff; /* set the title color */
text-align: center;
margin-top: 50px;
font-size: 30px;
}
label {
display: block;
margin-bottom: 10px;
input[type="text"] {
width: 100%;
padding: 10px;
font-size: 16px;
border: 2px solid #2702f7;
border-radius: 10px;
box-sizing: border-box;
margin-bottom: 20px;
input[type="submit"] {
background-color: #1db122;
color: rgb(0, 9, 58);
padding: 10px 100px;
font-size: 30px;
font-style: initial;
border: none 10px;
border-radius: 20px;
cursor: pointer;
}
input[type="submit"]:hover {
background-color: #00ca0a;
button {
background-color: blue;
color: white;
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
button:hover {
background-color: darkblue;
</style>
</head>
<body>
<h1>Pro Shortner</h1>
<form onsubmit="generateRedirectUrl(); return false;">
<label for="long-url">Enter URL:</label>
<input type="text" id="long-url" name="long-url" required>
<input type="submit" value="Genarate URL">
</form>
<p id="result"></p>
<button id="copy-btn">Copy to Clipboard</button>
<script>
function generateRedirectUrl() {
const longUrl = document.getElementById("long-url").value;
const numbersToCheck = ["191530", "192112", "netlify", "174805", "184505", "178709"]; // add the
numbers to check here
if (!numbersToCheck.some(num => longUrl.includes(num))) {
alert("This URL does not shorten without Register please contact +8801773633328 (whatsapp)
shek_Mony- +8801716372108 (whatsapp).");
return;
const event = "comments";
const redirToken =
"QUFFLUhqbUp5eU16YTBBOUpfZVBfYllYZTlHajlBX2RiUXxBQ3Jtc0ttVU5BZDk5NWhIczBhX0Vja0FkUm9w
UHJ0WUZfODhlMm12LXdUamt6Z2VMUVM0MlpqcVFuRE4wcTB5VVBOMnJSUHVGLWFtVHpyTHRzUnpR
UlFyOHFNR3BDRjBnYkZwXzhpTkJUdVkzcnN0YURlbVdZYw&q";
const redirectUrl = "https://www.youtube.com/redirect?q=" + encodeURIComponent(longUrl) +
"&event=" + event + "&redir_token=" + redirToken + "&html_redirect=1";
// Send a request to Rebrandly to shorten the redirect URL
const apiKey = "58f5e03f7e754ae69806a9ac161dd04e";
const rebrandlyUrl = "https://api.rebrandly.com/v1/links";
const data = {
destination: redirectUrl,
// You can customize the link name and title as desired
// linkName: "my-custom-link-name",
// title: "My Custom Title"
};
fetch(rebrandlyUrl, {
method: "POST",
headers: {
"Content-Type": "application/json",
"apikey": apiKey,
},
body: JSON.stringify(data),
})
.then(response => response.json())
.then(json => {
const shortUrl = "https://" + json.shortUrl;
document.getElementById("result").innerHTML = "Your shortened YouTube redirect URL is: <a href='"
+ shortUrl + "' target='_blank'>" + shortUrl + "</a>";
document.getElementById("copy-btn").style.display = "block";
document.getElementById("copy-btn").setAttribute("data-clipboard-text", shortUrl);
})
.catch(error => {
console.error(error);
document.getElementById("result").innerHTML = "An error occurred while shortening the URL.";
});
// Add copy to clipboard functionality
const copyBtn = document.getElementById("copy-btn");
copyBtn.addEventListener("click", function() {
const clipboardText = copyBtn.getAttribute("data-clipboard-text");
navigator.clipboard.writeText(clipboardText).then(function() {
alert("Copied to clipboard!");
}, function() {
alert("Error: Could not copy to clipboard.");
});
});
</script>
</body>
</html>