Extractor Button

Agrega un botón de extractor a https://www.xvideos.com/profileslist

Tính đến 03-06-2023. Xem phiên bản mới nhất.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

Bạn sẽ cần cài đặt một tiện ích mở rộng như Tampermonkey hoặc Violentmonkey để cài đặt kịch bản này.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @license MIT
// ==UserScript==
// @name         Extractor Button
// @namespace    https://www.example.com
// @version      1.0.1
// @description  Agrega un botón de extractor a https://www.xvideos.com/profileslist
// @author       Tu Nombre
// @match        https://www.xvideos.com/profileslist
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Función para mostrar la ventana de solicitud de palabras clave
    function showPrompt() {
        var usernameKeywords = prompt('Ingrese la palabra o grupo de palabras de interés para los nombres de usuario:');
        var aboutMeKeywords = prompt('Ingrese la palabra o grupo de palabras de interés para el "about me":');
        
        if (usernameKeywords && aboutMeKeywords) {
            extractData(usernameKeywords, aboutMeKeywords);
        }
    }

    // Función para extraer los datos y verificar las palabras clave
    function extractData(usernameKeywords, aboutMeKeywords) {
        var profileElements = document.querySelectorAll('.thumb-block-profile');

        var matchingUsernames = [];
        var matchingAboutMe = [];

        for (var i = 0; i < profileElements.length; i++) {
            var profileElement = profileElements[i];
            var usernameElement = profileElement.querySelector('.profile-name a');
            var aboutMeElement = profileElement.querySelector('.profile-aboutme-content p');

            if (usernameElement && aboutMeElement) {
                var username = usernameElement.textContent.trim();
                var aboutMe = aboutMeElement.textContent.trim();

                // Verificar si el nombre de usuario contiene las palabras clave (ignorando mayúsculas y minúsculas)
                if (username.toLowerCase().includes(usernameKeywords.toLowerCase())) {
                    matchingUsernames.push(username);
                }

                // Verificar si el "about me" contiene las palabras clave (ignorando mayúsculas y minúsculas)
                if (aboutMe.toLowerCase().includes(aboutMeKeywords.toLowerCase())) {
                    matchingAboutMe.push(aboutMe);
                }
            }
        }

        var message = '';

        if (matchingUsernames.length > 0) {
            message += 'Nombres de usuario encontrados:\n\n' + matchingUsernames.join('\n') + '\n\n';
        } else {
            message += 'No se encontraron nombres de usuario que coincidan con las palabras clave.\n\n';
        }

        if (matchingAboutMe.length > 0) {
            message += 'About Me encontrados:\n\n' + matchingAboutMe.join('\n');
        } else {
            message += 'No se encontraron About Me que coincidan con las palabras clave.';
        }

        alert(message);
    }

    // Crear el botón
    var button = document.createElement('button');
    button.innerText = 'Extractor';

    // Estilo del botón
    button.style.position = 'fixed';
    button.style.top = '20px';
    button.style.right = '20px';
    button.style.zIndex = '9999';
    button.style.padding = '10px 20px';
    button.style.background = '#4285f4';
    button.style.color = 'white';
    button.style.border = 'none';
    button.style.borderRadius = '4px';
    button.style.cursor = 'pointer';

    // Agregar evento clic al botón
    button.addEventListener('click', showPrompt);

    // Agregar el botón al documento
    document.body.appendChild(button);
})();