Lovoo Auto Like with Stop Condition and Modern UI

Automates "Like" clicks on Lovoo, shows a modern UI for each like, waits before clicking, and stops if "Likes are exhausted" message appears

当前为 2024-12-10 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        Lovoo Auto Like with Stop Condition and Modern UI
// @namespace   Tempermonkey Scripts
// @match       https://**.lovoo.com/*
// @grant       none
// @version     1.0
// @author      Manu OVG
// @license MIT
// @description Automates "Like" clicks on Lovoo, shows a modern UI for each like, waits before clicking, and stops if "Likes are exhausted" message appears
// ==/UserScript==

// Function to simulate a "Like" click
async function autoLike() {
    // Check if the message "Tes « j’aime » sont épuisés" is displayed
    const noMoreLikesMessage = document.querySelector('.space-before.space-after.h3.u-text-center.u-padding-top-sm');
    if (noMoreLikesMessage && noMoreLikesMessage.textContent.includes('Tes « j’aime » sont épuisés')) {
        // Display a modern "No more likes" notification
        showNotification("No more likes available. Stopping...");
        console.log("No more likes available. Stopping script.");
        return; // Stop the script if the message is found
    }

    // Find all "Like" buttons
    const likeButtons = document.querySelectorAll('span[data-automation-id="vote-yes-button"]');

    // If there are "Like" buttons, click one
    if (likeButtons.length > 0) {
        // Get the first "Like" button (you can modify this if you want to target a specific user)
        const likeButton = likeButtons[0];

        // Show the "Liked" UI notification first
        showNotification("You've liked a user!");

        // Wait 1 second to display the notification
        setTimeout(() => {
            // Now simulate the click after the delay
            likeButton.click();
        }, 1000);  // Show the notification for 1 second before clicking the "Like" button
    }

    // Wait for 1 to 3 seconds to simulate a delay before clicking again
    const delay = Math.floor(Math.random() * 2000) + 1000; // Random delay between 1-3 seconds
    setTimeout(autoLike, delay);
}

// Function to show a modern UI notification
function showNotification(message) {
    // Create the notification element
    const notification = document.createElement('div');
    notification.innerHTML = `
        <div style="position: fixed; top: 20px; right: 20px; background-color: #4CAF50; color: white; padding: 15px 25px; border-radius: 10px; font-family: Arial, sans-serif; font-size: 16px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); z-index: 9999;">
            <strong>${message}</strong>
        </div>
    `;

    // Append the notification to the body
    document.body.appendChild(notification);

    // Automatically remove the notification after 3 seconds
    setTimeout(() => {
        notification.remove();
    }, 3000);
}

// Start the auto-like function after the page is loaded
window.addEventListener('load', () => {
    setTimeout(autoLike, 1000); // Start after a 1-second delay to ensure the page is fully loaded
});