Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function () {
- const whatsappLinkRegex = /https:\/\/chat\.whatsapp\.com\/[a-zA-Z0-9]+/g;
- const foundLinks = new Set();
- // Create download button
- const button = document.createElement("button");
- button.textContent = "📥 Download WhatsApp Links (0)";
- button.style.position = "fixed";
- button.style.top = "20px";
- button.style.right = "20px";
- button.style.zIndex = "9999";
- button.style.padding = "10px 15px";
- button.style.backgroundColor = "#25D366";
- button.style.color = "#fff";
- button.style.border = "none";
- button.style.borderRadius = "5px";
- button.style.cursor = "pointer";
- button.style.fontSize = "14px";
- document.body.appendChild(button);
- // Function to update button text with count
- const updateButtonText = () => {
- button.textContent = `📥 Download WhatsApp Links (${foundLinks.size})`;
- };
- // Check and collect new links every 2 seconds
- const checkForLinks = () => {
- const html = document.documentElement.innerHTML;
- const matches = html.match(whatsappLinkRegex) || [];
- matches.forEach(link => {
- if (!foundLinks.has(link)) {
- foundLinks.add(link);
- console.log("🟢 New WhatsApp Link:", link);
- updateButtonText();
- }
- });
- };
- setInterval(checkForLinks, 2000);
- console.log("🔍 Watching for new WhatsApp links as you scroll...");
- // Download links on button click
- button.addEventListener("click", () => {
- const blob = new Blob([Array.from(foundLinks).join("\n")], { type: "text/plain" });
- const url = URL.createObjectURL(blob);
- const a = document.createElement("a");
- a.href = url;
- a.download = "whatsapp_links.txt";
- a.click();
- URL.revokeObjectURL(url);
- });
- })();
Advertisement
Add Comment
Please, Sign In to add comment