Last active
February 5, 2024 08:13
-
-
Save av1d/f2603d193a55934be16fddafb52dcbf2 to your computer and use it in GitHub Desktop.
Extract Aliexpres (s.click.aliexpress.com) links from Google (googleadservices) spy tracking referral links
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
if you use PiHole or similar you may have bumped into this | |
issue when Google spams you with referral links as the top | |
result and you can't load them. Well, no longer. Now you | |
can easily extract the link. Fsck Google! | |
Just paste the googleadservices link in, click decode and... tada! | |
--> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Extract and Decode Link</title> | |
</head> | |
<body> | |
<textarea id="inputText" rows="10" cols="50"></textarea><br> | |
<button onclick="extractAndDecodeLink()">Extract and Decode Link</button> | |
<p id="output"></p> | |
<script> | |
function extractAndDecodeLink() { | |
const inputText = document.getElementById('inputText').value; | |
const regex = /(https%253A%252F%252Fwww\.aliexpress\.com%252Fitem%252F\d+\.html)/g; | |
const match = inputText.match(regex); | |
if (match) { | |
const decodedLink = match[0].replace(/%25/g, '%'); | |
const actualLink = decodeURIComponent(decodedLink); | |
document.getElementById('output').textContent = actualLink; | |
} else { | |
document.getElementById('output').textContent = "Link not found in input."; | |
} | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment