Extractor Button

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

Ajankohdalta 3.6.2023. Katso uusin versio.

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

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 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.

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

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
// @name         Extractor Button
// @namespace    https://www.example.com
// @version      1.0.7
// @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 los nombres de usuario en un popup
    function showUsernamesPopup(usernames) {
        var popup = window.open('', 'Usernames Popup', 'width=400,height=300,resizable=yes,scrollbars=yes');
        var popupDocument = popup.document;

        var title = popupDocument.createElement('h3');
        title.textContent = 'Nombres de usuario encontrados:';
        popupDocument.body.appendChild(title);

        var list = popupDocument.createElement('ul');
        usernames.forEach(function(username) {
            var listItem = popupDocument.createElement('li');
            listItem.textContent = username;
            list.appendChild(listItem);
        });
        popupDocument.body.appendChild(list);
    }

    // Función para mostrar los "about me" en un popup
    function showAboutMePopup(aboutMe) {
        var popup = window.open('', 'About Me Popup', 'width=400,height=300,resizable=yes,scrollbars=yes');
        var popupDocument = popup.document;

        var title = popupDocument.createElement('h3');
        title.textContent = 'About Me encontrados:';
        popupDocument.body.appendChild(title);

        var list = popupDocument.createElement('ul');
        aboutMe.forEach(function(text) {
            var listItem = popupDocument.createElement('li');
            listItem.textContent = text;
            list.appendChild(listItem);
        });
        popupDocument.body.appendChild(list);
    }

    // Función para extraer los datos y verificar las palabras clave
    function extractData(event) {
        event.preventDefault();

        var form = event.target;
        var usernameKeywords = form.elements.usernameKeywords.value.trim();
        var aboutMeKeywords = form.elements.aboutMeKeywords.value.trim();

        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 (usernameKeywords && username.toLowerCase().includes(usernameKeywords.toLowerCase())) {
                    matchingUsernames.push(username);
                }

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

        if (matchingUsernames.length > 0) {
            showUsernamesPopup(matchingUsernames);
        }

        if (matchingAboutMe.length > 0) {
            showAboutMePopup(matchingAboutMe);
        }
    }

    // Crear el formulario
    var formContainer = document.createElement('div');
    formContainer.style.position = 'fixed';
    formContainer.style.top = '20px';
    formContainer.style.right = '20px';
    formContainer.style.zIndex = '9999';
    formContainer.style.display = 'flex';

    var form = document.createElement('form');
    form.addEventListener('submit', extractData);

    var usernameInput = document.createElement('input');
    usernameInput.name = 'usernameKeywords';
    usernameInput.placeholder = 'Palabras clave para nombres de usuario';
    usernameInput.style.marginRight = '10px';
    form.appendChild(usernameInput);

    var aboutMeInput = document.createElement('input');
    aboutMeInput.name = 'aboutMeKeywords';
    aboutMeInput.placeholder = 'Palabras clave para "about me"';
    form.appendChild(aboutMeInput);

    var extractButton = document.createElement('button');
    extractButton.type = 'submit';
    extractButton.innerText = 'Extractor';
    extractButton.style.background = '#4285f4';
    extractButton.style.color = 'white';
    extractButton.style.border = 'none';
    extractButton.style.borderRadius = '4px';
    extractButton.style.padding = '10px 20px';
    extractButton.style.cursor = 'pointer';
    form.appendChild(extractButton);

    formContainer.appendChild(form);

    // Agregar el formulario al documento
    document.body.appendChild(formContainer);
})();